diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md index 22cf70d8f2233..ae2270a06a270 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2023-07-27) + +- Azure Resource Manager Machine Learning client library for Java. This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2023-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md index 1521aeacd892d..3be77035c8709 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Machine Learning client library for Java. -This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2023-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-machinelearning - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,49 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +workspace = machineLearningManager.workspaces() + .define(workspaceName) + .withExistingResourceGroup(resourceGroupName) + .withRegion(REGION) + .withSku(new Sku().withName("Basic").withTier(SkuTier.BASIC)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withFriendlyName(workspaceName) + .withStorageAccount( + storageManager.storageAccounts() + .define(storageName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withSku(StorageAccountSkuType.STANDARD_LRS) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_0) + .withHnsEnabled(false) + .withAccessFromAzureServices() + .withOnlyHttpsTraffic() + .withBlobStorageAccountKind().withAccessTier(AccessTier.HOT) + .create() + .id()) + .withKeyVault( + keyVaultManager.vaults() + .define(keyVaultName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withEmptyAccessPolicy() + .withSku(SkuName.STANDARD) + .withDeploymentDisabled() + .withAccessFromAllNetworks() + .create() + .id()) + .withApplicationInsights( + applicationInsightsManager.components() + .define(insightName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withKind("web") + .withApplicationType(ApplicationType.WEB) + .create() + .id()) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md) @@ -103,3 +146,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fmachinelearning%2Fazure-resourcemanager-machinelearning%2FREADME.png) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md index aace5155fc337..acb19d3083094 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md @@ -27,6 +27,7 @@ ## CodeVersions +- [CreateOrGetStartPendingUpload](#codeversions_createorgetstartpendingupload) - [CreateOrUpdate](#codeversions_createorupdate) - [Delete](#codeversions_delete) - [Get](#codeversions_get) @@ -48,16 +49,20 @@ ## Compute +- [AllowedResizeSizes](#compute_allowedresizesizes) - [CreateOrUpdate](#compute_createorupdate) - [Delete](#compute_delete) - [Get](#compute_get) - [List](#compute_list) - [ListKeys](#compute_listkeys) - [ListNodes](#compute_listnodes) +- [Resize](#compute_resize) - [Restart](#compute_restart) - [Start](#compute_start) - [Stop](#compute_stop) - [Update](#compute_update) +- [UpdateCustomServices](#compute_updatecustomservices) +- [UpdateIdleShutdownSetting](#compute_updateidleshutdownsetting) ## DataContainers @@ -95,6 +100,41 @@ - [Get](#environmentversions_get) - [List](#environmentversions_list) +## Features + +- [Get](#features_get) +- [List](#features_list) + +## FeaturesetContainers + +- [CreateOrUpdate](#featuresetcontainers_createorupdate) +- [Delete](#featuresetcontainers_delete) +- [GetEntity](#featuresetcontainers_getentity) +- [List](#featuresetcontainers_list) + +## FeaturesetVersions + +- [Backfill](#featuresetversions_backfill) +- [CreateOrUpdate](#featuresetversions_createorupdate) +- [Delete](#featuresetversions_delete) +- [Get](#featuresetversions_get) +- [List](#featuresetversions_list) +- [ListMaterializationJobs](#featuresetversions_listmaterializationjobs) + +## FeaturestoreEntityContainers + +- [CreateOrUpdate](#featurestoreentitycontainers_createorupdate) +- [Delete](#featurestoreentitycontainers_delete) +- [GetEntity](#featurestoreentitycontainers_getentity) +- [List](#featurestoreentitycontainers_list) + +## FeaturestoreEntityVersions + +- [CreateOrUpdate](#featurestoreentityversions_createorupdate) +- [Delete](#featurestoreentityversions_delete) +- [Get](#featurestoreentityversions_get) +- [List](#featurestoreentityversions_list) + ## Jobs - [Cancel](#jobs_cancel) @@ -102,6 +142,28 @@ - [Delete](#jobs_delete) - [Get](#jobs_get) - [List](#jobs_list) +- [Update](#jobs_update) + +## LabelingJobs + +- [CreateOrUpdate](#labelingjobs_createorupdate) +- [Delete](#labelingjobs_delete) +- [ExportLabels](#labelingjobs_exportlabels) +- [Get](#labelingjobs_get) +- [List](#labelingjobs_list) +- [Pause](#labelingjobs_pause) +- [Resume](#labelingjobs_resume) + +## ManagedNetworkProvisions + +- [ProvisionManagedNetwork](#managednetworkprovisions_provisionmanagednetwork) + +## ManagedNetworkSettingsRule + +- [CreateOrUpdate](#managednetworksettingsrule_createorupdate) +- [Delete](#managednetworksettingsrule_delete) +- [Get](#managednetworksettingsrule_get) +- [List](#managednetworksettingsrule_list) ## ModelContainers @@ -116,6 +178,7 @@ - [Delete](#modelversions_delete) - [Get](#modelversions_get) - [List](#modelversions_list) +- [PackageMethod](#modelversions_packagemethod) ## OnlineDeployments @@ -158,6 +221,90 @@ - [List](#quotas_list) - [Update](#quotas_update) +## Registries + +- [CreateOrUpdate](#registries_createorupdate) +- [Delete](#registries_delete) +- [GetByResourceGroup](#registries_getbyresourcegroup) +- [List](#registries_list) +- [ListByResourceGroup](#registries_listbyresourcegroup) +- [RemoveRegions](#registries_removeregions) +- [Update](#registries_update) + +## RegistryCodeContainers + +- [CreateOrUpdate](#registrycodecontainers_createorupdate) +- [Delete](#registrycodecontainers_delete) +- [Get](#registrycodecontainers_get) +- [List](#registrycodecontainers_list) + +## RegistryCodeVersions + +- [CreateOrGetStartPendingUpload](#registrycodeversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrycodeversions_createorupdate) +- [Delete](#registrycodeversions_delete) +- [Get](#registrycodeversions_get) +- [List](#registrycodeversions_list) + +## RegistryComponentContainers + +- [CreateOrUpdate](#registrycomponentcontainers_createorupdate) +- [Delete](#registrycomponentcontainers_delete) +- [Get](#registrycomponentcontainers_get) +- [List](#registrycomponentcontainers_list) + +## RegistryComponentVersions + +- [CreateOrUpdate](#registrycomponentversions_createorupdate) +- [Delete](#registrycomponentversions_delete) +- [Get](#registrycomponentversions_get) +- [List](#registrycomponentversions_list) + +## RegistryDataContainers + +- [CreateOrUpdate](#registrydatacontainers_createorupdate) +- [Delete](#registrydatacontainers_delete) +- [Get](#registrydatacontainers_get) +- [List](#registrydatacontainers_list) + +## RegistryDataVersions + +- [CreateOrGetStartPendingUpload](#registrydataversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrydataversions_createorupdate) +- [Delete](#registrydataversions_delete) +- [Get](#registrydataversions_get) +- [List](#registrydataversions_list) + +## RegistryEnvironmentContainers + +- [CreateOrUpdate](#registryenvironmentcontainers_createorupdate) +- [Delete](#registryenvironmentcontainers_delete) +- [Get](#registryenvironmentcontainers_get) +- [List](#registryenvironmentcontainers_list) + +## RegistryEnvironmentVersions + +- [CreateOrUpdate](#registryenvironmentversions_createorupdate) +- [Delete](#registryenvironmentversions_delete) +- [Get](#registryenvironmentversions_get) +- [List](#registryenvironmentversions_list) + +## RegistryModelContainers + +- [CreateOrUpdate](#registrymodelcontainers_createorupdate) +- [Delete](#registrymodelcontainers_delete) +- [Get](#registrymodelcontainers_get) +- [List](#registrymodelcontainers_list) + +## RegistryModelVersions + +- [CreateOrGetStartPendingUpload](#registrymodelversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrymodelversions_createorupdate) +- [Delete](#registrymodelversions_delete) +- [Get](#registrymodelversions_get) +- [List](#registrymodelversions_list) +- [PackageMethod](#registrymodelversions_packagemethod) + ## Schedules - [CreateOrUpdate](#schedules_createorupdate) @@ -179,6 +326,8 @@ - [Delete](#workspaceconnections_delete) - [Get](#workspaceconnections_get) - [List](#workspaceconnections_list) +- [ListSecrets](#workspaceconnections_listsecrets) +- [Update](#workspaceconnections_update) ## WorkspaceFeatures @@ -225,14 +374,14 @@ import java.util.Map; /** Samples for BatchDeployments CreateOrUpdate. */ public final class BatchDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Deployment. + * Sample code: CreateOrUpdate Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchDeployment( + public static void createOrUpdateWorkspaceBatchDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { manager .batchDeployments() @@ -304,14 +453,15 @@ public final class BatchDeploymentsCreateOrUpdateSamples { /** Samples for BatchDeployments Delete. */ public final class BatchDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/delete.json */ /** - * Sample code: Delete Batch Deployment. + * Sample code: Delete Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .delete( @@ -330,14 +480,15 @@ public final class BatchDeploymentsDeleteSamples { /** Samples for BatchDeployments Get. */ public final class BatchDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/get.json */ /** - * Sample code: Get Batch Deployment. + * Sample code: Get Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .getWithResponse( @@ -356,14 +507,15 @@ public final class BatchDeploymentsGetSamples { /** Samples for BatchDeployments List. */ public final class BatchDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/list.json */ /** - * Sample code: List Batch Deployment. + * Sample code: List Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .list( @@ -383,14 +535,15 @@ import java.util.Map; /** Samples for BatchDeployments Update. */ public final class BatchDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/update.json */ /** - * Sample code: Update Batch Deployment. + * Sample code: Update Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void updateWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { BatchDeployment resource = manager .batchDeployments() @@ -438,14 +591,14 @@ import java.util.Map; /** Samples for BatchEndpoints CreateOrUpdate. */ public final class BatchEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Endpoint. + * Sample code: CreateOrUpdate Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchEndpoint( + public static void createOrUpdateWorkspaceBatchEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() @@ -493,14 +646,15 @@ public final class BatchEndpointsCreateOrUpdateSamples { /** Samples for BatchEndpoints Delete. */ public final class BatchEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/delete.json */ /** - * Sample code: Delete Batch Endpoint. + * Sample code: Delete Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .delete("resourceGroup-1234", "testworkspace", "testBatchEndpoint", com.azure.core.util.Context.NONE); @@ -514,14 +668,15 @@ public final class BatchEndpointsDeleteSamples { /** Samples for BatchEndpoints Get. */ public final class BatchEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/get.json */ /** - * Sample code: Get Batch Endpoint. + * Sample code: Get Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); @@ -535,14 +690,15 @@ public final class BatchEndpointsGetSamples { /** Samples for BatchEndpoints List. */ public final class BatchEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/list.json */ /** - * Sample code: List Batch Endpoint. + * Sample code: List Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.batchEndpoints().list("test-rg", "my-aml-workspace", 1, null, com.azure.core.util.Context.NONE); } } @@ -554,14 +710,15 @@ public final class BatchEndpointsListSamples { /** Samples for BatchEndpoints ListKeys. */ public final class BatchEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/listKeys.json */ /** - * Sample code: ListKeys Batch Endpoint. + * Sample code: ListKeys Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listKeysWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); @@ -584,15 +741,15 @@ import java.util.Map; /** Samples for BatchEndpoints Update. */ public final class BatchEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/update.json */ /** - * Sample code: Update Batch Endpoint. + * Sample code: Update Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { + public static void updateWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { BatchEndpoint resource = manager .batchEndpoints() @@ -629,6 +786,7 @@ public final class BatchEndpointsUpdateSamples { ### CodeContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; import java.util.HashMap; import java.util.Map; @@ -636,24 +794,27 @@ import java.util.Map; /** Samples for CodeContainers CreateOrUpdate. */ public final class CodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Container. + * Sample code: CreateOrUpdate Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeContainer( + public static void createOrUpdateWorkspaceCodeContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new CodeContainerProperties() - .withDescription("string") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + .createOrUpdateWithResponse( + "testrg123", + "testworkspace", + "testContainer", + new CodeContainerInner() + .withProperties( + new CodeContainerProperties() + .withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -675,14 +836,15 @@ public final class CodeContainersCreateOrUpdateSamples { /** Samples for CodeContainers Delete. */ public final class CodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/delete.json */ /** - * Sample code: Delete Code Container. + * Sample code: Delete Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); @@ -696,14 +858,15 @@ public final class CodeContainersDeleteSamples { /** Samples for CodeContainers Get. */ public final class CodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/get.json */ /** - * Sample code: Get Code Container. + * Sample code: Get Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() .getWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); @@ -717,22 +880,57 @@ public final class CodeContainersGetSamples { /** Samples for CodeContainers List. */ public final class CodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/list.json */ /** - * Sample code: List Code Container. + * Sample code: List Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.codeContainers().list("testrg123", "testworkspace", null, com.azure.core.util.Context.NONE); } } ``` +### CodeVersions_CreateOrGetStartPendingUpload + +```java +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for CodeVersions CreateOrGetStartPendingUpload. */ +public final class CodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .codeVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); + } +} +``` + ### CodeVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; import java.util.HashMap; import java.util.Map; @@ -740,27 +938,31 @@ import java.util.Map; /** Samples for CodeVersions CreateOrUpdate. */ public final class CodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Version. + * Sample code: CreateOrUpdate Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeVersion( + public static void createOrUpdateWorkspaceCodeVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() - .define("string") - .withExistingCode("test-rg", "my-aml-workspace", "string") - .withProperties( - new CodeVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withCodeUri("fakeTokenPlaceholder")) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new CodeVersionInner() + .withProperties( + new CodeVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -782,14 +984,15 @@ public final class CodeVersionsCreateOrUpdateSamples { /** Samples for CodeVersions Delete. */ public final class CodeVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/delete.json */ /** - * Sample code: Delete Code Version. + * Sample code: Delete Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -803,14 +1006,15 @@ public final class CodeVersionsDeleteSamples { /** Samples for CodeVersions Get. */ public final class CodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/get.json */ /** - * Sample code: Get Code Version. + * Sample code: Get Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -824,17 +1028,27 @@ public final class CodeVersionsGetSamples { /** Samples for CodeVersions List. */ public final class CodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/list.json */ /** - * Sample code: List Code Version. + * Sample code: List Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); } } ``` @@ -842,6 +1056,7 @@ public final class CodeVersionsListSamples { ### ComponentContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -849,25 +1064,28 @@ import java.util.Map; /** Samples for ComponentContainers CreateOrUpdate. */ public final class ComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Container. + * Sample code: CreateOrUpdate Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentContainer( + public static void createOrUpdateWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ComponentContainerProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string"))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + new ComponentContainerInner() + .withProperties( + new ComponentContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -889,14 +1107,14 @@ public final class ComponentContainersCreateOrUpdateSamples { /** Samples for ComponentContainers Delete. */ public final class ComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/delete.json */ /** - * Sample code: Delete Component Container. + * Sample code: Delete Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentContainer( + public static void deleteWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() @@ -911,14 +1129,15 @@ public final class ComponentContainersDeleteSamples { /** Samples for ComponentContainers Get. */ public final class ComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/get.json */ /** - * Sample code: Get Component Container. + * Sample code: Get Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); @@ -932,14 +1151,14 @@ public final class ComponentContainersGetSamples { /** Samples for ComponentContainers List. */ public final class ComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/list.json */ /** - * Sample code: List Component Container. + * Sample code: List Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentContainer( + public static void listWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.componentContainers().list("test-rg", "my-aml-workspace", null, null, com.azure.core.util.Context.NONE); } @@ -951,6 +1170,7 @@ public final class ComponentContainersListSamples { ```java import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; import java.io.IOException; import java.util.HashMap; @@ -959,33 +1179,37 @@ import java.util.Map; /** Samples for ComponentVersions CreateOrUpdate. */ public final class ComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Version. + * Sample code: CreateOrUpdate Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentVersion( + public static void createOrUpdateWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { manager .componentVersions() - .define("string") - .withExistingComponent("test-rg", "my-aml-workspace", "string") - .withProperties( - new ComponentVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withComponentSpec( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", - Object.class, - SerializerEncoding.JSON))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new ComponentVersionInner() + .withProperties( + new ComponentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withComponentSpec( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", + Object.class, + SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -1007,14 +1231,14 @@ public final class ComponentVersionsCreateOrUpdateSamples { /** Samples for ComponentVersions Delete. */ public final class ComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/delete.json */ /** - * Sample code: Delete Component Version. + * Sample code: Delete Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentVersion( + public static void deleteWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() @@ -1029,14 +1253,15 @@ public final class ComponentVersionsDeleteSamples { /** Samples for ComponentVersions Get. */ public final class ComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/get.json */ /** - * Sample code: Get Component Version. + * Sample code: Get Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -1050,17 +1275,49 @@ public final class ComponentVersionsGetSamples { /** Samples for ComponentVersions List. */ public final class ComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/list.json */ /** - * Sample code: List Component Version. + * Sample code: List Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Compute_AllowedResizeSizes + +```java +/** Samples for Compute AllowedResizeSizes. */ +public final class ComputeAllowedResizeSizesSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/allowedVMSizesForResize.json + */ + /** + * Sample code: List VM Sizes. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .allowedResizeSizesWithResponse( + "testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } ``` @@ -1076,29 +1333,48 @@ import com.azure.resourcemanager.machinelearning.models.ApplicationSharingPolicy import com.azure.resourcemanager.machinelearning.models.AssignedUser; import com.azure.resourcemanager.machinelearning.models.ComputeInstance; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAuthorizationType; +import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAutologgerSettings; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceProperties; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceSshSettings; +import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; +import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; +import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; +import com.azure.resourcemanager.machinelearning.models.Cron; +import com.azure.resourcemanager.machinelearning.models.CustomService; import com.azure.resourcemanager.machinelearning.models.DataFactory; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; import com.azure.resourcemanager.machinelearning.models.Kubernetes; import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; +import com.azure.resourcemanager.machinelearning.models.MlflowAutologger; import com.azure.resourcemanager.machinelearning.models.OsType; import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; +import com.azure.resourcemanager.machinelearning.models.Protocol; import com.azure.resourcemanager.machinelearning.models.RemoteLoginPortPublicAccess; import com.azure.resourcemanager.machinelearning.models.ResourceId; import com.azure.resourcemanager.machinelearning.models.ScaleSettings; +import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; import com.azure.resourcemanager.machinelearning.models.SshPublicAccess; +import com.azure.resourcemanager.machinelearning.models.TriggerType; import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; import com.azure.resourcemanager.machinelearning.models.VmPriority; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; import java.time.Duration; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** Samples for Compute CreateOrUpdate. */ public final class ComputeCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. @@ -1116,7 +1392,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. @@ -1139,7 +1415,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/KubernetesCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. @@ -1176,7 +1452,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. @@ -1204,12 +1480,26 @@ public final class ComputeCreateOrUpdateSamples { .withAssignedUser( new AssignedUser() .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + .withTenantId("00000000-0000-0000-0000-000000000000"))) + .withSchedules( + new ComputeSchedules() + .withComputeStartStop( + Arrays + .asList( + new ComputeStartStopSchedule() + .withStatus(ScheduleStatus.ENABLED) + .withAction(ComputePowerAction.STOP) + .withTriggerType(TriggerType.CRON) + .withCron( + new Cron() + .withStartTime("2021-04-23T01:30:00") + .withTimeZone("Pacific Standard Time") + .withExpression("0 18 * * *"))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. @@ -1245,7 +1535,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstance.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. @@ -1266,9 +1556,49 @@ public final class ComputeCreateOrUpdateSamples { .withVmSize("STANDARD_NC6") .withSubnet(new ResourceId().withId("test-subnet-resource-id")) .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withAutologgerSettings( + new ComputeInstanceAutologgerSettings().withMlflowAutologger(MlflowAutologger.ENABLED)) .withSshSettings( new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withCustomServices( + Arrays + .asList( + new CustomService() + .withName("rstudio-workbench") + .withImage( + new Image() + .withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rstudio-workbench:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables( + mapOf( + "RSP_LICENSE", + new EnvironmentVariable() + .withType(EnvironmentVariableType.LOCAL) + .withValue("XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX") + .withAdditionalProperties(mapOf()))) + .withDocker( + new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints( + Arrays + .asList( + new Endpoint() + .withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(4444))) + .withVolumes( + Arrays + .asList( + new VolumeDefinition() + .withType(VolumeDefinitionType.BIND) + .withReadOnly(true) + .withSource("/mnt/azureuser/") + .withTarget("/home/testuser/"))) + .withAdditionalProperties(mapOf()))) .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withEnableOSPatching(true) + .withReleaseQuotaOnStop(true) .withPersonalComputeInstanceSettings( new PersonalComputeInstanceSettings() .withAssignedUser( @@ -1279,7 +1609,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. @@ -1299,7 +1629,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. @@ -1326,7 +1656,7 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json */ /** * Sample code: Create a DataFactory Compute. @@ -1365,7 +1695,7 @@ import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction /** Samples for Compute Delete. */ public final class ComputeDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/delete.json */ /** * Sample code: Delete Compute. @@ -1391,7 +1721,7 @@ public final class ComputeDeleteSamples { /** Samples for Compute Get. */ public final class ComputeGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/AKSCompute.json */ /** * Sample code: Get a AKS Compute. @@ -1405,7 +1735,7 @@ public final class ComputeGetSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/KubernetesCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. @@ -1419,7 +1749,7 @@ public final class ComputeGetSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/ComputeInstance.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. @@ -1433,7 +1763,7 @@ public final class ComputeGetSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/AmlCompute.json */ /** * Sample code: Get a AML Compute. @@ -1454,7 +1784,7 @@ public final class ComputeGetSamples { /** Samples for Compute List. */ public final class ComputeListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/list.json */ /** * Sample code: Get Computes. @@ -1473,7 +1803,7 @@ public final class ComputeListSamples { /** Samples for Compute ListKeys. */ public final class ComputeListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/listKeys.json */ /** * Sample code: List AKS Compute Keys. @@ -1494,7 +1824,7 @@ public final class ComputeListKeysSamples { /** Samples for Compute ListNodes. */ public final class ComputeListNodesSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listNodes.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/listNodes.json */ /** * Sample code: Get compute nodes information for a compute. @@ -1508,13 +1838,41 @@ public final class ComputeListNodesSamples { } ``` +### Compute_Resize + +```java +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; + +/** Samples for Compute Resize. */ +public final class ComputeResizeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/resize.json + */ + /** + * Sample code: List VM Sizes. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .resize( + "testrg123", + "workspaces123", + "compute123", + new ResizeSchema().withTargetVMSize("Standard_DS11_v2"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Compute_Restart ```java /** Samples for Compute Restart. */ public final class ComputeRestartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/restart.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/restart.json */ /** * Sample code: Restart ComputeInstance Compute. @@ -1534,7 +1892,7 @@ public final class ComputeRestartSamples { /** Samples for Compute Start. */ public final class ComputeStartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/start.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/start.json */ /** * Sample code: Start ComputeInstance Compute. @@ -1554,7 +1912,7 @@ public final class ComputeStartSamples { /** Samples for Compute Stop. */ public final class ComputeStopSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/stop.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/stop.json */ /** * Sample code: Stop ComputeInstance Compute. @@ -1579,7 +1937,7 @@ import java.time.Duration; /** Samples for Compute Update. */ public final class ComputeUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/patch.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/patch.json */ /** * Sample code: Update a AmlCompute Compute. @@ -1607,37 +1965,75 @@ public final class ComputeUpdateSamples { } ``` -### DataContainers_CreateOrUpdate +### Compute_UpdateCustomServices ```java -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; +import com.azure.resourcemanager.machinelearning.models.Protocol; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for DataContainers CreateOrUpdate. */ -public final class DataContainersCreateOrUpdateSamples { +/** Samples for Compute UpdateCustomServices. */ +public final class ComputeUpdateCustomServicesSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/updateCustomServices.json */ /** - * Sample code: CreateOrUpdate Data Container. + * Sample code: Update Custom Services. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void updateCustomServices(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .dataContainers() - .define("datacontainer123") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new DataContainerProperties() - .withDescription("string") - .withProperties(mapOf("properties1", "value1", "properties2", "value2")) - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDataType(DataType.fromString("UriFile"))) - .create(); + .computes() + .updateCustomServicesWithResponse( + "testrg123", + "workspaces123", + "compute123", + Arrays + .asList( + new CustomService() + .withName("rstudio-workbench") + .withImage( + new Image() + .withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rstudio-workbench:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables( + mapOf( + "RSP_LICENSE", + new EnvironmentVariable() + .withType(EnvironmentVariableType.LOCAL) + .withValue("XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX") + .withAdditionalProperties(mapOf()))) + .withDocker(new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints( + Arrays + .asList( + new Endpoint() + .withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(4444))) + .withVolumes( + Arrays + .asList( + new VolumeDefinition() + .withType(VolumeDefinitionType.BIND) + .withReadOnly(true) + .withSource("/mnt/azureuser/") + .withTarget("/home/testuser/"))) + .withAdditionalProperties(mapOf())), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -1653,46 +2049,127 @@ public final class DataContainersCreateOrUpdateSamples { } ``` -### DataContainers_Delete +### Compute_UpdateIdleShutdownSetting ```java -/** Samples for DataContainers Delete. */ -public final class DataContainersDeleteSamples { +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; + +/** Samples for Compute UpdateIdleShutdownSetting. */ +public final class ComputeUpdateIdleShutdownSettingSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/updateIdleShutdownSetting.json */ /** - * Sample code: Delete Data Container. + * Sample code: Update idle shutdown setting of ComputeInstance. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void updateIdleShutdownSettingOfComputeInstance( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .dataContainers() - .deleteWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); + .computes() + .updateIdleShutdownSettingWithResponse( + "testrg123", + "workspaces123", + "compute123", + new IdleShutdownSetting().withIdleTimeBeforeShutdown("PT120M"), + com.azure.core.util.Context.NONE); } } ``` -### DataContainers_Get +### DataContainers_CreateOrUpdate ```java -/** Samples for DataContainers Get. */ -public final class DataContainersGetSamples { +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; +import com.azure.resourcemanager.machinelearning.models.DataType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DataContainers CreateOrUpdate. */ +public final class DataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/createOrUpdate.json */ /** - * Sample code: Get Data Container. + * Sample code: CreateOrUpdate Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void createOrUpdateWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataContainers() - .getWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); + .createOrUpdateWithResponse( + "testrg123", + "workspace123", + "datacontainer123", + new DataContainerInner() + .withProperties( + new DataContainerProperties() + .withDescription("string") + .withProperties(mapOf("properties1", "value1", "properties2", "value2")) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withDataType(DataType.fromString("UriFile"))), + com.azure.core.util.Context.NONE); } -} + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DataContainers_Delete + +```java +/** Samples for DataContainers Delete. */ +public final class DataContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/delete.json + */ + /** + * Sample code: Delete Workspace Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .dataContainers() + .deleteWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); + } +} +``` + +### DataContainers_Get + +```java +/** Samples for DataContainers Get. */ +public final class DataContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/get.json + */ + /** + * Sample code: Get Workspace Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .dataContainers() + .getWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); + } +} ``` ### DataContainers_List @@ -1701,14 +2178,15 @@ public final class DataContainersGetSamples { /** Samples for DataContainers List. */ public final class DataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/list.json */ /** - * Sample code: List Data Container. + * Sample code: List Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.dataContainers().list("testrg123", "workspace123", null, null, com.azure.core.util.Context.NONE); } } @@ -1717,6 +2195,7 @@ public final class DataContainersListSamples { ### DataVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; import java.util.HashMap; import java.util.Map; @@ -1724,27 +2203,31 @@ import java.util.Map; /** Samples for DataVersions CreateOrUpdate. */ public final class DataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Version Base. + * Sample code: CreateOrUpdate Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataVersionBase( + public static void createOrUpdateWorkspaceDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() - .define("string") - .withExistingData("test-rg", "my-aml-workspace", "string") - .withProperties( - new UriFileDataVersion() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withDataUri("string")) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new DataVersionBaseInner() + .withProperties( + new UriFileDataVersion() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withDataUri("string")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -1766,14 +2249,15 @@ public final class DataVersionsCreateOrUpdateSamples { /** Samples for DataVersions Delete. */ public final class DataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/delete.json */ /** - * Sample code: Delete Data Version Base. + * Sample code: Delete Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -1787,14 +2271,15 @@ public final class DataVersionsDeleteSamples { /** Samples for DataVersions Get. */ public final class DataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/get.json */ /** - * Sample code: Get Data Version Base. + * Sample code: Get Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void getDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -1808,14 +2293,15 @@ public final class DataVersionsGetSamples { /** Samples for DataVersions List. */ public final class DataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/list.json */ /** - * Sample code: List Data Version Base. + * Sample code: List Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void listDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .list( @@ -1827,6 +2313,7 @@ public final class DataVersionsListSamples { null, "string", null, + null, com.azure.core.util.Context.NONE); } } @@ -1850,7 +2337,7 @@ import java.util.UUID; /** Samples for Datastores CreateOrUpdate. */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen1 w/ ServicePrincipal). @@ -1881,7 +2368,7 @@ public final class DatastoresCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen2 w/ Service Principal). @@ -1915,7 +2402,7 @@ public final class DatastoresCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (AzureBlob w/ AccountKey). @@ -1944,7 +2431,7 @@ public final class DatastoresCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure File store w/ AccountKey). @@ -1991,7 +2478,7 @@ public final class DatastoresCreateOrUpdateSamples { /** Samples for Datastores Delete. */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/delete.json */ /** * Sample code: Delete datastore. @@ -2012,7 +2499,7 @@ public final class DatastoresDeleteSamples { /** Samples for Datastores Get. */ public final class DatastoresGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/get.json */ /** * Sample code: Get datastore. @@ -2033,7 +2520,7 @@ import java.util.Arrays; /** Samples for Datastores List. */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/list.json */ /** * Sample code: List datastores. @@ -2064,7 +2551,7 @@ public final class DatastoresListSamples { /** Samples for Datastores ListSecrets. */ public final class DatastoresListSecretsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/listSecrets.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/listSecrets.json */ /** * Sample code: Get datastore secrets. @@ -2082,6 +2569,7 @@ public final class DatastoresListSecretsSamples { ### EnvironmentContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -2089,27 +2577,42 @@ import java.util.Map; /** Samples for EnvironmentContainers CreateOrUpdate. */ public final class EnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Container. + * Sample code: CreateOrUpdate Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentContainer( + public static void createOrUpdateWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() - .define("testEnvironment") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new EnvironmentContainerProperties() - .withDescription("string") + .createOrUpdateWithResponse( + "testrg123", + "testworkspace", + "testEnvironment", + new EnvironmentContainerInner() .withProperties( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) - .withTags( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) - .create(); + new EnvironmentContainerProperties() + .withDescription("string") + .withProperties( + mapOf( + "additionalProp1", + "string", + "additionalProp2", + "string", + "additionalProp3", + "string")) + .withTags( + mapOf( + "additionalProp1", + "string", + "additionalProp2", + "string", + "additionalProp3", + "string"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -2131,14 +2634,14 @@ public final class EnvironmentContainersCreateOrUpdateSamples { /** Samples for EnvironmentContainers Delete. */ public final class EnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Environment Container. + * Sample code: Delete Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentContainer( + public static void deleteWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() @@ -2153,14 +2656,14 @@ public final class EnvironmentContainersDeleteSamples { /** Samples for EnvironmentContainers Get. */ public final class EnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/get.json */ /** - * Sample code: Get Environment Container. + * Sample code: Get Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentContainer( + public static void getWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() @@ -2175,14 +2678,14 @@ public final class EnvironmentContainersGetSamples { /** Samples for EnvironmentContainers List. */ public final class EnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/list.json */ /** - * Sample code: List Environment Container. + * Sample code: List Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentContainer( + public static void listWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() @@ -2194,6 +2697,7 @@ public final class EnvironmentContainersListSamples { ### EnvironmentVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; import com.azure.resourcemanager.machinelearning.models.BuildContext; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; @@ -2204,38 +2708,42 @@ import java.util.Map; /** Samples for EnvironmentVersions CreateOrUpdate. */ public final class EnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Version. + * Sample code: CreateOrUpdate Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentVersion( + public static void createOrUpdateWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() - .define("string") - .withExistingEnvironment("test-rg", "my-aml-workspace", "string") - .withProperties( - new EnvironmentVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withBuild( - new BuildContext() - .withContextUri( - "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") - .withDockerfilePath("prod/Dockerfile")) - .withCondaFile("string") - .withImage("docker.io/tensorflow/serving:latest") - .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("string").withPort(1)) - .withReadinessRoute(new Route().withPath("string").withPort(1)) - .withScoringRoute(new Route().withPath("string").withPort(1)))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new EnvironmentVersionInner() + .withProperties( + new EnvironmentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild( + new BuildContext() + .withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties() + .withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -2257,14 +2765,14 @@ public final class EnvironmentVersionsCreateOrUpdateSamples { /** Samples for EnvironmentVersions Delete. */ public final class EnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/delete.json */ /** - * Sample code: Delete Environment Version. + * Sample code: Delete Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentVersion( + public static void deleteWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() @@ -2279,14 +2787,15 @@ public final class EnvironmentVersionsDeleteSamples { /** Samples for EnvironmentVersions Get. */ public final class EnvironmentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/get.json */ /** - * Sample code: Get Environment Version. + * Sample code: Get Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); @@ -2300,314 +2809,3368 @@ public final class EnvironmentVersionsGetSamples { /** Samples for EnvironmentVersions List. */ public final class EnvironmentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/list.json */ /** - * Sample code: List Environment Version. + * Sample code: List Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentVersion( + public static void listWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); } } ``` -### Jobs_Cancel +### Features_Get ```java -/** Samples for Jobs Cancel. */ -public final class JobsCancelSamples { +/** Samples for Features Get. */ +public final class FeaturesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/cancel.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Feature/get.json */ /** - * Sample code: Cancel Job. + * Sample code: Get Feature. * * @param manager Entry point to MachineLearningManager. */ - public static void cancelJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().cancel("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void getFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .features() + .getWithResponse( + "test-rg", "my-aml-workspace", "string", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### Jobs_CreateOrUpdate +### Features_List ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.models.AmlToken; -import com.azure.resourcemanager.machinelearning.models.AutoMLJob; -import com.azure.resourcemanager.machinelearning.models.CommandJob; -import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; -import com.azure.resourcemanager.machinelearning.models.Goal; -import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.ImageClassification; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; -import com.azure.resourcemanager.machinelearning.models.Mpi; -import com.azure.resourcemanager.machinelearning.models.Objective; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.PipelineJob; -import com.azure.resourcemanager.machinelearning.models.SweepJob; -import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; -import com.azure.resourcemanager.machinelearning.models.TensorFlow; -import com.azure.resourcemanager.machinelearning.models.TrialComponent; -import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; -import java.io.IOException; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Jobs CreateOrUpdate. */ -public final class JobsCreateOrUpdateSamples { +/** Samples for Features List. */ +public final class FeaturesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Feature/list.json */ /** - * Sample code: CreateOrUpdate AutoML Job. + * Sample code: List Feature. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { + public static void listFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AutoMLJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withIsArchived(false) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", - Object.class, - SerializerEncoding.JSON)))) - .withTaskDetails( - new ImageClassification() - .withTargetColumnName("string") - .withTrainingData(new MLTableJobInput().withUri("string")) - .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withValidationCropSize("choice(2, 360)"))) - .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) - .create(); + .features() + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + null, + "string", + "string", + "string", + com.azure.core.util.Context.NONE); } +} +``` + +### FeaturesetContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import java.util.HashMap; +import java.util.Map; +/** Samples for FeaturesetContainers CreateOrUpdate. */ +public final class FeaturesetContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Sweep Job. + * Sample code: CreateOrUpdate Workspace Featureset Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { + public static void createOrUpdateWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() + .featuresetContainers() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") .withProperties( - new SweepJob() + new FeaturesetContainerProperties() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) - .withLimits( - new SweepJobLimits() - .withMaxConcurrentTrials(1) - .withMaxTotalTrials(1) - .withTrialTimeout(Duration.parse("PT1S"))) - .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) - .withSamplingAlgorithm(new GridSamplingAlgorithm()) - .withSearchSpace( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) - .withTrial( - new TrialComponent() - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new Mpi().withProcessCountPerInstance(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON)))))) + .withIsArchived(false)) .create(); } + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetContainers_Delete + +```java +/** Samples for FeaturesetContainers Delete. */ +public final class FeaturesetContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/delete.json */ /** - * Sample code: CreateOrUpdate Pipeline Job. + * Sample code: Delete Workspace Featureset Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdatePipelineJob( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + public static void deleteWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") + .featuresetContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetContainers_GetEntity + +```java +/** Samples for FeaturesetContainers GetEntity. */ +public final class FeaturesetContainersGetEntitySamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetContainers_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturesetContainers List. */ +public final class FeaturesetContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/list.json + */ + /** + * Sample code: List Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + ListViewType.ARCHIVED_ONLY, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_Backfill + +```java +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturesetVersions Backfill. */ +public final class FeaturesetVersionsBackfillSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/backfill.json + */ + /** + * Sample code: Backfill Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void backfillWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .backfill( + "test-rg", + "my-aml-workspace", + "string", + "string", + new FeaturesetVersionBackfillRequest() + .withDescription("string") + .withDisplayName("string") + .withFeatureWindow( + new FeatureWindow() + .withFeatureWindowEnd(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51")) + .withFeatureWindowStart(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSparkConfiguration(mapOf("string", "string")) + .withTags(mapOf("string", "string")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; +import com.azure.resourcemanager.machinelearning.models.FeaturesetSpecification; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import com.azure.resourcemanager.machinelearning.models.MaterializationSettings; +import com.azure.resourcemanager.machinelearning.models.MaterializationStoreType; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; +import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; +import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; +import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; +import com.azure.resourcemanager.machinelearning.models.WeekDay; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturesetVersions CreateOrUpdate. */ +public final class FeaturesetVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .define("string") + .withExistingFeatureset("test-rg", "my-aml-workspace", "string") .withProperties( - new PipelineJob() + new FeaturesetVersionProperties() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.UPLOAD) - .withUri("string"))) - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withIsAnonymous(false) + .withIsArchived(false) + .withEntities(Arrays.asList("string")) + .withMaterializationSettings( + new MaterializationSettings() + .withNotification( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_FAILED)) + .withEmails(Arrays.asList("string"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSchedule( + new RecurrenceTrigger() + .withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withFrequency(RecurrenceFrequency.DAY) + .withInterval(1) + .withSchedule( + new RecurrenceSchedule() + .withHours(Arrays.asList(1)) + .withMinutes(Arrays.asList(1)) + .withMonthDays(Arrays.asList(1)) + .withWeekDays(Arrays.asList(WeekDay.MONDAY)))) + .withSparkConfiguration(mapOf("string", "string")) + .withStoreType(MaterializationStoreType.ONLINE)) + .withSpecification(new FeaturesetSpecification().withPath("string")) + .withStage("string")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetVersions_Delete + +```java +/** Samples for FeaturesetVersions Delete. */ +public final class FeaturesetVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_Get + +```java +/** Samples for FeaturesetVersions Get. */ +public final class FeaturesetVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/get.json + */ + /** + * Sample code: Get Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturesetVersions List. */ +public final class FeaturesetVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/list.json + */ + /** + * Sample code: List Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .list( + "test-rg", + "my-aml-workspace", + "string", + null, + "string", + ListViewType.ALL, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_ListMaterializationJobs + +```java +/** Samples for FeaturesetVersions ListMaterializationJobs. */ +public final class FeaturesetVersionsListMaterializationJobsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/listMaterializationJobs.json + */ + /** + * Sample code: ListMaterializationJobs Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listMaterializationJobsWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .listMaterializationJobs( + "test-rg", + "my-aml-workspace", + "string", + "string", + null, + "string", + "string", + "string", + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturestoreEntityContainers CreateOrUpdate. */ +public final class FeaturestoreEntityContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new FeaturestoreEntityContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) .create(); } + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturestoreEntityContainers_Delete + +```java +/** Samples for FeaturestoreEntityContainers Delete. */ +public final class FeaturestoreEntityContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_GetEntity + +```java +/** Samples for FeaturestoreEntityContainers GetEntity. */ +public final class FeaturestoreEntityContainersGetEntitySamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturestoreEntityContainers List. */ +public final class FeaturestoreEntityContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + ListViewType.ALL, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeatureDataType; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import com.azure.resourcemanager.machinelearning.models.IndexColumn; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturestoreEntityVersions CreateOrUpdate. */ +public final class FeaturestoreEntityVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .define("string") + .withExistingFeaturestoreEntity("test-rg", "my-aml-workspace", "string") + .withProperties( + new FeaturestoreEntityVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withIndexColumns( + Arrays + .asList(new IndexColumn().withColumnName("string").withDataType(FeatureDataType.DATETIME)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturestoreEntityVersions_Delete + +```java +/** Samples for FeaturestoreEntityVersions Delete. */ +public final class FeaturestoreEntityVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_Get + +```java +/** Samples for FeaturestoreEntityVersions Get. */ +public final class FeaturestoreEntityVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + */ + /** + * Sample code: Get Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturestoreEntityVersions List. */ +public final class FeaturestoreEntityVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .list( + "test-rg", + "my-aml-workspace", + "string", + null, + "string", + ListViewType.ACTIVE_ONLY, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Cancel + +```java +/** Samples for Jobs Cancel. */ +public final class JobsCancelSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/cancel.json + */ + /** + * Sample code: Cancel Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void cancelJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().cancel("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.AllNodes; +import com.azure.resourcemanager.machinelearning.models.AmlToken; +import com.azure.resourcemanager.machinelearning.models.AutologgerSettings; +import com.azure.resourcemanager.machinelearning.models.CommandJob; +import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; +import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; +import com.azure.resourcemanager.machinelearning.models.JobService; +import com.azure.resourcemanager.machinelearning.models.JobTier; +import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; +import com.azure.resourcemanager.machinelearning.models.MLFlowAutologgerState; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; +import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PipelineJob; +import com.azure.resourcemanager.machinelearning.models.QueueSettings; +import com.azure.resourcemanager.machinelearning.models.TensorFlow; +import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; +import java.io.IOException; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs CreateOrUpdate. */ +public final class JobsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) + throws IOException { + manager + .jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new CommandJob() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComponentId("string") + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_COMPLETED)) + .withEmails(Arrays.asList("string"))) + .withServices( + mapOf( + "string", + new JobService() + .withEndpoint("string") + .withJobServiceType("string") + .withNodes(new AllNodes()) + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs( + mapOf( + "string", + new UriFileJobOutput() + .withDescription("string") + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.DIRECT) + .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.PREMIUM).withPriority(1)) + .withResources( + new JobResourceConfiguration() + .withInstanceCount(1) + .withInstanceType("string") + .withLocations(Arrays.asList("string")) + .withProperties( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"f69c8d5a-9b39-4183-92d3-a2b18944cf95\":null}", + Object.class, + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) + throws IOException { + manager + .jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new CommandJob() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComponentId("string") + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_COMPLETED)) + .withEmails(Arrays.asList("string"))) + .withServices( + mapOf( + "string", + new JobService() + .withEndpoint("string") + .withJobServiceType("string") + .withNodes(new AllNodes()) + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs( + mapOf( + "string", + new UriFileJobOutput() + .withDescription("string") + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.BASIC).withPriority(1)) + .withResources( + new JobResourceConfiguration() + .withInstanceCount(1) + .withInstanceType("string") + .withLocations(Arrays.asList("string")) + .withProperties( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"5fc1f627-491e-45a0-a6a2-f5b4be884911\":null}", + Object.class, + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdatePipelineJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager + .jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new PipelineJob() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withServices( + mapOf( + "string", + new JobService() + .withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withOutputs( + mapOf( + "string", + new UriFileJobOutput() + .withDescription("string") + .withMode(OutputDeliveryMode.UPLOAD) + .withUri("string"))) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateCommandJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager + .jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new CommandJob() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComponentId("string") + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_CANCELLED)) + .withEmails(Arrays.asList("string"))) + .withServices( + mapOf( + "string", + new JobService() + .withEndpoint("string") + .withJobServiceType("string") + .withNodes(new AllNodes()) + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs( + mapOf( + "string", + new UriFileJobOutput() + .withDescription("string") + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.UPLOAD) + .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.BASIC).withPriority(1)) + .withResources( + new JobResourceConfiguration() + .withInstanceCount(1) + .withInstanceType("string") + .withLocations(Arrays.asList("string")) + .withProperties( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"c9ac10d0-915b-4de5-afe8-a4c78a37a558\":null}", + Object.class, + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Jobs_Delete + +```java +/** Samples for Jobs Delete. */ +public final class JobsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/delete.json + */ + /** + * Sample code: Delete Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Get + +```java +/** Samples for Jobs Get. */ +public final class JobsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/get.json + */ + /** + * Sample code: Get Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/get.json + */ + /** + * Sample code: Get AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/get.json + */ + /** + * Sample code: Get Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/get.json + */ + /** + * Sample code: Get Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for Jobs List. */ +public final class JobsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/list.json + */ + /** + * Sample code: List Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .jobs() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ACTIVE_ONLY, + "string", + false, + "string", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/list.json + */ + /** + * Sample code: List Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .jobs() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/list.json + */ + /** + * Sample code: List Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .jobs() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ACTIVE_ONLY, + "string", + false, + "string", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/list.json + */ + /** + * Sample code: List AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .jobs() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ALL, + "string", + false, + "string", + com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Update + +```java +import com.azure.resourcemanager.machinelearning.models.AzureDevOpsWebhook; +import com.azure.resourcemanager.machinelearning.models.JobBase; +import com.azure.resourcemanager.machinelearning.models.PartialJobBase; +import com.azure.resourcemanager.machinelearning.models.PartialNotificationSetting; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/update.json + */ + /** + * Sample code: Update Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + JobBase resource = + manager + .jobs() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new PartialJobBase() + .withNotificationSetting( + new PartialNotificationSetting() + .withWebhooks(mapOf("string", new AzureDevOpsWebhook().withEventType("string"))))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LabelingJobs_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.LabelCategory; +import com.azure.resourcemanager.machinelearning.models.LabelClass; +import com.azure.resourcemanager.machinelearning.models.LabelingJobImageProperties; +import com.azure.resourcemanager.machinelearning.models.LabelingJobInstructions; +import com.azure.resourcemanager.machinelearning.models.LabelingJobProperties; +import com.azure.resourcemanager.machinelearning.models.MLAssistConfigurationEnabled; +import com.azure.resourcemanager.machinelearning.models.MultiSelect; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LabelingJobs CreateOrUpdate. */ +public final class LabelingJobsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateLabelingJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .define("testLabelingJob") + .withExistingWorkspace("workspace-1234", "testworkspace") + .withProperties( + new LabelingJobProperties() + .withDescription("string") + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withJobInstructions(new LabelingJobInstructions().withUri("link/to/instructions")) + .withLabelCategories( + mapOf( + "myCategory1", + new LabelCategory() + .withClasses( + mapOf( + "myLabelClass1", + new LabelClass().withDisplayName("myLabelClass1").withSubclasses(mapOf()), + "myLabelClass2", + new LabelClass().withDisplayName("myLabelClass2").withSubclasses(mapOf()))) + .withDisplayName("myCategory1Title") + .withMultiSelect(MultiSelect.DISABLED), + "myCategory2", + new LabelCategory() + .withClasses( + mapOf( + "myLabelClass1", + new LabelClass().withDisplayName("myLabelClass1").withSubclasses(mapOf()), + "myLabelClass2", + new LabelClass().withDisplayName("myLabelClass2").withSubclasses(mapOf()))) + .withDisplayName("myCategory2Title") + .withMultiSelect(MultiSelect.DISABLED))) + .withLabelingJobMediaProperties(new LabelingJobImageProperties()) + .withMlAssistConfiguration( + new MLAssistConfigurationEnabled() + .withInferencingComputeBinding( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute") + .withTrainingComputeBinding( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LabelingJobs_Delete + +```java +/** Samples for LabelingJobs Delete. */ +public final class LabelingJobsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/delete.json + */ + /** + * Sample code: Delete Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .deleteWithResponse("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} +``` + +### LabelingJobs_ExportLabels + +```java +import com.azure.resourcemanager.machinelearning.models.DatasetExportSummary; + +/** Samples for LabelingJobs ExportLabels. */ +public final class LabelingJobsExportLabelsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/exportLabels.json + */ + /** + * Sample code: ExportLabels Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void exportLabelsLabelingJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .exportLabels( + "workspace-1234", + "testworkspace", + "testLabelingJob", + new DatasetExportSummary(), + com.azure.core.util.Context.NONE); + } +} +``` + +### LabelingJobs_Get + +```java +/** Samples for LabelingJobs Get. */ +public final class LabelingJobsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/get.json + */ + /** + * Sample code: Get Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .getWithResponse( + "workspace-1234", "testworkspace", "testLabelingJob", true, true, com.azure.core.util.Context.NONE); + } +} +``` + +### LabelingJobs_List + +```java +/** Samples for LabelingJobs List. */ +public final class LabelingJobsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/list.json + */ + /** + * Sample code: List Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.labelingJobs().list("workspace-1234", "testworkspace", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### LabelingJobs_Pause + +```java +/** Samples for LabelingJobs Pause. */ +public final class LabelingJobsPauseSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/pause.json + */ + /** + * Sample code: Pause Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void pauseLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .pauseWithResponse("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} +``` + +### LabelingJobs_Resume + +```java +/** Samples for LabelingJobs Resume. */ +public final class LabelingJobsResumeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/resume.json + */ + /** + * Sample code: Resume Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void resumeLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .resume("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkProvisions_ProvisionManagedNetwork + +```java +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** Samples for ManagedNetworkProvisions ProvisionManagedNetwork. */ +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/provision.json + */ + /** + * Sample code: Provision ManagedNetwork. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void provisionManagedNetwork( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkProvisions() + .provisionManagedNetwork( + "test-rg", + "aml-workspace-name", + new ManagedNetworkProvisionOptions().withIncludeSpark(false), + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FqdnOutboundRule; +import com.azure.resourcemanager.machinelearning.models.RuleCategory; +import com.azure.resourcemanager.machinelearning.models.RuleStatus; + +/** Samples for ManagedNetworkSettingsRule CreateOrUpdate. */ +public final class ManagedNetworkSettingsRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + */ + /** + * Sample code: CreateOrUpdate ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .define("some_string") + .withExistingWorkspace("test-rg", "aml-workspace-name") + .withProperties( + new FqdnOutboundRule() + .withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("some_string")) + .create(); + } +} +``` + +### ManagedNetworkSettingsRule_Delete + +```java +/** Samples for ManagedNetworkSettingsRule Delete. */ +public final class ManagedNetworkSettingsRuleDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/deleteRule.json + */ + /** + * Sample code: Delete ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .delete("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_Get + +```java +/** Samples for ManagedNetworkSettingsRule Get. */ +public final class ManagedNetworkSettingsRuleGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/getRule.json + */ + /** + * Sample code: Get ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .getWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_List + +```java +/** Samples for ManagedNetworkSettingsRule List. */ +public final class ManagedNetworkSettingsRuleListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/listRule.json + */ + /** + * Sample code: List ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules().list("test-rg", "aml-workspace-name", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ModelContainers CreateOrUpdate. */ +public final class ModelContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelContainers() + .createOrUpdateWithResponse( + "testrg123", + "workspace123", + "testContainer", + new ModelContainerInner() + .withProperties( + new ModelContainerProperties() + .withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ModelContainers_Delete + +```java +/** Samples for ModelContainers Delete. */ +public final class ModelContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/delete.json + */ + /** + * Sample code: Delete Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelContainers() + .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_Get + +```java +/** Samples for ModelContainers Get. */ +public final class ModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/get.json + */ + /** + * Sample code: Get Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelContainers() + .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_List + +```java +/** Samples for ModelContainers List. */ +public final class ModelContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/list.json + */ + /** + * Sample code: List Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ModelVersions CreateOrUpdate. */ +public final class ModelVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new ModelVersionInner() + .withProperties( + new ModelVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ModelVersions_Delete + +```java +/** Samples for ModelVersions Delete. */ +public final class ModelVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/delete.json + */ + /** + * Sample code: Delete Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_Get + +```java +/** Samples for ModelVersions Get. */ +public final class ModelVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/get.json + */ + /** + * Sample code: Get Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_List + +```java +/** Samples for ModelVersions List. */ +public final class ModelVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/list.json + */ + /** + * Sample code: List Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .list( + "test-rg", + "my-aml-workspace", + "string", + null, + "string", + 1, + "string", + "string", + 1, + "string", + "string", + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_PackageMethod + +```java +import com.azure.resourcemanager.machinelearning.models.AzureMLBatchInferencingServer; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentId; +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageInputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PackageInputPathUrl; +import com.azure.resourcemanager.machinelearning.models.PackageInputType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ModelVersions PackageMethod. */ +public final class ModelVersionsPackageMethodSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/package.json + */ + /** + * Sample code: Package Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void packageWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .packageMethod( + "test-rg", + "my-aml-workspace", + "string", + "string", + new PackageRequest() + .withBaseEnvironmentSource(new BaseEnvironmentId().withResourceId("string")) + .withEnvironmentVariables(mapOf("string", "string")) + .withInferencingServer( + new AzureMLBatchInferencingServer() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string"))) + .withInputs( + Arrays + .asList( + new ModelPackageInput() + .withInputType(PackageInputType.URI_FILE) + .withMode(PackageInputDeliveryMode.DOWNLOAD) + .withMountPath("string") + .withPath(new PackageInputPathUrl().withUrl("string")))) + .withModelConfiguration( + new ModelConfiguration() + .withMode(PackageInputDeliveryMode.fromString("ReadOnlyMount")) + .withMountPath("string")) + .withTags(mapOf("string", "string")) + .withTargetEnvironmentId("string"), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineDeployments_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; +import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; +import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; +import com.azure.resourcemanager.machinelearning.models.KubernetesOnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.ManagedOnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; +import com.azure.resourcemanager.machinelearning.models.ProbeSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OnlineDeployments CreateOrUpdate. */ +public final class OnlineDeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateKubernetesOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .define("testDeploymentName") + .withRegion("string") + .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") + .withProperties( + new KubernetesOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe( + new ProbeSettings() + .withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withRequestSettings( + new OnlineRequestSettings() + .withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings()) + .withContainerResourceRequirements( + new ContainerResourceRequirements() + .withContainerResourceLimits( + new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) + .withContainerResourceRequests( + new ContainerResourceSettings() + .withCpu("\"1\"") + .withGpu("\"1\"") + .withMemory("\"2Gi\"")))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .define("testDeploymentName") + .withRegion("string") + .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") + .withProperties( + new ManagedOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe( + new ProbeSettings() + .withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withReadinessProbe( + new ProbeSettings() + .withFailureThreshold(30) + .withInitialDelay(Duration.parse("PT1S")) + .withPeriod(Duration.parse("PT10S")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT2S"))) + .withRequestSettings( + new OnlineRequestSettings() + .withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings())) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineDeployments_Delete + +```java +/** Samples for OnlineDeployments Delete. */ +public final class OnlineDeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineDeployment/delete.json + */ + /** + * Sample code: Delete Workspace Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .delete("testrg123", "workspace123", "testEndpoint", "testDeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_Get + +```java +/** Samples for OnlineDeployments Get. */ +public final class OnlineDeploymentsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + */ + /** + * Sample code: Get Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getKubernetesOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .getWithResponse( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + */ + /** + * Sample code: Get Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getManagedOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .getWithResponse( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_GetLogs + +```java +import com.azure.resourcemanager.machinelearning.models.ContainerType; +import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; + +/** Samples for OnlineDeployments GetLogs. */ +public final class OnlineDeploymentsGetLogsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/getLogs.json + */ + /** + * Sample code: Get Online Deployment Logs. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getOnlineDeploymentLogs( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .getLogsWithResponse( + "testrg123", + "workspace123", + "testEndpoint", + "testDeployment", + new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(0), + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_List + +```java +/** Samples for OnlineDeployments List. */ +public final class OnlineDeploymentsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/list.json + */ + /** + * Sample code: List Online Deployments. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listOnlineDeployments(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .list( + "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_ListSkus + +```java +/** Samples for OnlineDeployments ListSkus. */ +public final class OnlineDeploymentsListSkusSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + */ + /** + * Sample code: List Managed Online Deployment Skus. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listManagedOnlineDeploymentSkus( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .listSkus( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + 1, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + */ + /** + * Sample code: List Kubernetes Online Deployment Skus. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listKubernetesOnlineDeploymentSkus( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineDeployments() + .listSkus( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + 1, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_Update + +```java +import com.azure.resourcemanager.machinelearning.models.OnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OnlineDeployments Update. */ +public final class OnlineDeploymentsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + */ + /** + * Sample code: Update Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateManagedOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = + manager + .onlineDeployments() + .getWithResponse( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) + .apply(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + */ + /** + * Sample code: Update Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateKubernetesOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = + manager + .onlineDeployments() + .getWithResponse( + "test-rg", + "my-aml-workspace", + "testEndpointName", + "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineEndpoints_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OnlineEndpoints CreateOrUpdate. */ +public final class OnlineEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .define("testEndpointName") + .withRegion("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new OnlineEndpointProperties() + .withAuthMode(EndpointAuthMode.AMLTOKEN) + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withCompute("string") + .withTraffic(mapOf("string", 1))) + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineEndpoints_Delete + +```java +/** Samples for OnlineEndpoints Delete. */ +public final class OnlineEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/delete.json + */ + /** + * Sample code: Delete Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_Get + +```java +/** Samples for OnlineEndpoints Get. */ +public final class OnlineEndpointsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/get.json + */ + /** + * Sample code: Get Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_GetToken + +```java +/** Samples for OnlineEndpoints GetToken. */ +public final class OnlineEndpointsGetTokenSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/getToken.json + */ + /** + * Sample code: GetToken Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getTokenWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_List + +```java +import com.azure.resourcemanager.machinelearning.models.EndpointComputeType; +import com.azure.resourcemanager.machinelearning.models.OrderString; + +/** Samples for OnlineEndpoints List. */ +public final class OnlineEndpointsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/list.json + */ + /** + * Sample code: List Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .list( + "test-rg", + "my-aml-workspace", + "string", + 1, + EndpointComputeType.MANAGED, + null, + "string", + "string", + OrderString.CREATED_AT_DESC, + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_ListKeys + +```java +/** Samples for OnlineEndpoints ListKeys. */ +public final class OnlineEndpointsListKeysSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json + */ + /** + * Sample code: ListKeys Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listKeysWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_RegenerateKeys + +```java +import com.azure.resourcemanager.machinelearning.models.KeyType; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; + +/** Samples for OnlineEndpoints RegenerateKeys. */ +public final class OnlineEndpointsRegenerateKeysSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json + */ + /** + * Sample code: RegenerateKeys Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void regenerateKeysWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .onlineEndpoints() + .regenerateKeys( + "test-rg", + "my-aml-workspace", + "testEndpointName", + new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineEndpoint; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OnlineEndpoints Update. */ +public final class OnlineEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/update.json + */ + /** + * Sample code: Update Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + OnlineEndpoint resource = + manager + .onlineEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new PartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/operationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void operationsList(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json + */ + /** + * Sample code: WorkspacePutPrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspacePutPrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingWorkspace("rg-1234", "testworkspace") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withDescription("Auto-Approved") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/delete.json + */ + /** + * Sample code: WorkspacePutPrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspacePutPrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .privateEndpointConnections() + .deleteWithResponse( + "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/get.json + */ + /** + * Sample code: WorkspaceGetPrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspaceGetPrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/list.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateEndpointConnections().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateLinkResource/list.json + */ + /** + * Sample code: WorkspaceListPrivateLinkResources. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspaceListPrivateLinkResources( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateLinkResources().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### Quotas_List + +```java +/** Samples for Quotas List. */ +public final class QuotasListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Quota/list.json + */ + /** + * Sample code: List workspace quotas by VMFamily. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceQuotasByVMFamily( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.quotas().list("eastus", com.azure.core.util.Context.NONE); + } +} +``` + +### Quotas_Update + +```java +import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; +import com.azure.resourcemanager.machinelearning.models.QuotaUnit; +import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; +import java.util.Arrays; + +/** Samples for Quotas Update. */ +public final class QuotasUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Quota/update.json + */ + /** + * Sample code: update quotas. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateQuotas(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .quotas() + .updateWithResponse( + "eastus", + new QuotaUpdateParameters() + .withValue( + Arrays + .asList( + new QuotaBaseProperties() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(100L) + .withUnit(QuotaUnit.COUNT), + new QuotaBaseProperties() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(200L) + .withUnit(QuotaUnit.COUNT))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries CreateOrUpdate. */ +public final class RegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/createOrUpdate-SystemCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")))))) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/createOrUpdate-UserCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withUserCreatedAcrAccount( + new UserCreatedAcrAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withUserCreatedStorageAccount( + new UserCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Delete + +```java +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/delete.json + */ + /** + * Sample code: Delete Registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().delete("test-rg", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_GetByResourceGroup + +```java +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/get-UserCreated.json + */ + /** + * Sample code: Get Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/get-SystemCreated.json + */ + /** + * Sample code: Get Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_List + +```java +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries by subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesBySubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListByResourceGroup + +```java +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/list-UserCreated.json + */ + /** + * Sample code: List registries with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/list-SystemCreated.json + */ + /** + * Sample code: List registries with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_RemoveRegions + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries RemoveRegions. */ +public final class RegistriesRemoveRegionsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/removeRegions.json + */ + /** + * Sample code: Remove regions from registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void removeRegionsFromRegistry( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .removeRegions( + "test-rg", + "string", + new RegistryInner() + .withLocation("string") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId( + new ArmResourceId().withResourceId("string"))) + .withUserCreatedAcrAccount( + new UserCreatedAcrAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withAllowBlobPublicAccess(false) + .withArmResourceId( + new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")) + .withUserCreatedStorageAccount( + new UserCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Update + +```java +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/update-UserCreated.json + */ + /** + * Sample code: Update Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/update-SystemCreated.json + */ + /** + * Sample code: Update Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RegistryCodeContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryCodeContainers CreateOrUpdate. */ +public final class RegistryCodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Command Job. + * Sample code: CreateOrUpdate Registry Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCommandJob( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + public static void createOrUpdateRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") + .registryCodeContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "testregistry") .withProperties( - new CommandJob() + new CodeContainerProperties() .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON))))) + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) .create(); } @@ -2624,168 +6187,243 @@ public final class JobsCreateOrUpdateSamples { } ``` -### Jobs_Delete +### RegistryCodeContainers_Delete ```java -/** Samples for Jobs Delete. */ -public final class JobsDeleteSamples { +/** Samples for RegistryCodeContainers Delete. */ +public final class RegistryCodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/delete.json */ /** - * Sample code: Delete Job. + * Sample code: Delete Registry Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void deleteRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### Jobs_Get +### RegistryCodeContainers_Get ```java -/** Samples for Jobs Get. */ -public final class JobsGetSamples { +/** Samples for RegistryCodeContainers Get. */ +public final class RegistryCodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/get.json */ /** - * Sample code: Get Command Job. + * Sample code: Get Registry Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void getRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeContainers() + .getWithResponse("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } +} +``` - /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/get.json - */ - /** - * Sample code: Get AutoML Job. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); - } +### RegistryCodeContainers_List +```java +/** Samples for RegistryCodeContainers List. */ +public final class RegistryCodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/list.json */ /** - * Sample code: Get Sweep Job. + * Sample code: List Registry Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void listRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers().list("testrg123", "testregistry", null, com.azure.core.util.Context.NONE); } +} +``` + +### RegistryCodeVersions_CreateOrGetStartPendingUpload +```java +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryCodeVersions CreateOrGetStartPendingUpload. */ +public final class RegistryCodeVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json */ /** - * Sample code: Get Pipeline Job. + * Sample code: CreateOrGetStartPendingUpload Registry Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void createOrGetStartPendingUploadRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); } } ``` -### Jobs_List +### RegistryCodeVersions_CreateOrUpdate ```java -/** Samples for Jobs List. */ -public final class JobsListSamples { +import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryCodeVersions CreateOrUpdate. */ +public final class RegistryCodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/createOrUpdate.json */ /** - * Sample code: List Command Job. + * Sample code: CreateOrUpdate Registry Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void createOrUpdateRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .registryCodeVersions() + .define("string") + .withExistingCode("test-rg", "my-aml-registry", "string") + .withProperties( + new CodeVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } +} +``` +### RegistryCodeVersions_Delete + +```java +/** Samples for RegistryCodeVersions Delete. */ +public final class RegistryCodeVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/delete.json */ /** - * Sample code: List Pipeline Job. + * Sample code: Delete Registry Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .registryCodeVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeVersions_Get + +```java +/** Samples for RegistryCodeVersions Get. */ +public final class RegistryCodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/get.json */ /** - * Sample code: List Sweep Job. + * Sample code: Get Registry Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .registryCodeVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeVersions_List + +```java +/** Samples for RegistryCodeVersions List. */ +public final class RegistryCodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/list.json */ /** - * Sample code: List AutoML Job. + * Sample code: List Registry Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, com.azure.core.util.Context.NONE); + public static void listRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_CreateOrUpdate +### RegistryComponentContainers_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ModelContainers CreateOrUpdate. */ -public final class ModelContainersCreateOrUpdateSamples { +/** Samples for RegistryComponentContainers CreateOrUpdate. */ +public final class RegistryComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Container. + * Sample code: CreateOrUpdate Registry Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelContainer( + public static void createOrUpdateRegistryComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "workspace123") + .registryComponentContainers() + .define("string") + .withExistingRegistry("test-rg", "my-aml-registry") .withProperties( - new ModelContainerProperties() - .withDescription("Model container description") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + new ComponentContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))) .create(); } @@ -2802,100 +6440,111 @@ public final class ModelContainersCreateOrUpdateSamples { } ``` -### ModelContainers_Delete +### RegistryComponentContainers_Delete ```java -/** Samples for ModelContainers Delete. */ -public final class ModelContainersDeleteSamples { +/** Samples for RegistryComponentContainers Delete. */ +public final class RegistryComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/delete.json */ /** - * Sample code: Delete Model Container. + * Sample code: Delete Registry Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelContainers() - .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + .registryComponentContainers() + .delete("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_Get +### RegistryComponentContainers_Get ```java -/** Samples for ModelContainers Get. */ -public final class ModelContainersGetSamples { +/** Samples for RegistryComponentContainers Get. */ +public final class RegistryComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/get.json */ /** - * Sample code: Get Model Container. + * Sample code: Get Registry Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelContainers() - .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + .registryComponentContainers() + .getWithResponse("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_List +### RegistryComponentContainers_List ```java -/** Samples for ModelContainers List. */ -public final class ModelContainersListSamples { +/** Samples for RegistryComponentContainers List. */ +public final class RegistryComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/list.json */ /** - * Sample code: List Model Container. + * Sample code: List Registry Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); + public static void listRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentContainers() + .list("test-rg", "my-aml-registry", null, com.azure.core.util.Context.NONE); } } ``` -### ModelVersions_CreateOrUpdate +### RegistryComponentVersions_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; +import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for ModelVersions CreateOrUpdate. */ -public final class ModelVersionsCreateOrUpdateSamples { +/** Samples for RegistryComponentVersions CreateOrUpdate. */ +public final class RegistryComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Version. + * Sample code: CreateOrUpdate Registry Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void createOrUpdateRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { manager - .modelVersions() + .registryComponentVersions() .define("string") - .withExistingModel("test-rg", "my-aml-workspace", "string") + .withExistingComponent("test-rg", "my-aml-registry", "string") .withProperties( - new ModelVersionProperties() + new ComponentVersionProperties() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) - .withModelType("CustomModel") - .withModelUri("string")) + .withComponentSpec( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", + Object.class, + SerializerEncoding.JSON))) .create(); } @@ -2912,230 +6561,103 @@ public final class ModelVersionsCreateOrUpdateSamples { } ``` -### ModelVersions_Delete - -```java -/** Samples for ModelVersions Delete. */ -public final class ModelVersionsDeleteSamples { - /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/delete.json - */ - /** - * Sample code: Delete Model Version. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void deleteModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); - } -} -``` - -### ModelVersions_Get +### RegistryComponentVersions_Delete ```java -/** Samples for ModelVersions Get. */ -public final class ModelVersionsGetSamples { +/** Samples for RegistryComponentVersions Delete. */ +public final class RegistryComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/delete.json */ /** - * Sample code: Get Model Version. + * Sample code: Delete Registry Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelVersions() - .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + .registryComponentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelVersions_List +### RegistryComponentVersions_Get ```java -/** Samples for ModelVersions List. */ -public final class ModelVersionsListSamples { +/** Samples for RegistryComponentVersions Get. */ +public final class RegistryComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/get.json */ /** - * Sample code: List Model Version. + * Sample code: Get Registry Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .modelVersions() - .list( - "test-rg", - "my-aml-workspace", - "string", - null, - "string", - 1, - "string", - "string", - 1, - "string", - "string", - null, - null, - com.azure.core.util.Context.NONE); + .registryComponentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_CreateOrUpdate +### RegistryComponentVersions_List ```java -import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; -import com.azure.resourcemanager.machinelearning.models.KubernetesOnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.ManagedOnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; -import com.azure.resourcemanager.machinelearning.models.ProbeSettings; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.time.Duration; -import java.util.HashMap; -import java.util.Map; - -/** Samples for OnlineDeployments CreateOrUpdate. */ -public final class OnlineDeploymentsCreateOrUpdateSamples { +/** Samples for RegistryComponentVersions List. */ +public final class RegistryComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/list.json */ /** - * Sample code: CreateOrUpdate Kubernetes Online Deployment. + * Sample code: List Registry Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateKubernetesOnlineDeployment( + public static void listRegistryComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .define("testDeploymentName") - .withRegion("string") - .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new KubernetesOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings()) - .withContainerResourceRequirements( - new ContainerResourceRequirements() - .withContainerResourceLimits( - new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) - .withContainerResourceRequests( - new ContainerResourceSettings() - .withCpu("\"1\"") - .withGpu("\"1\"") - .withMemory("\"2Gi\"")))) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) - .create(); + .registryComponentVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } +} +``` + +### RegistryDataContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; +import com.azure.resourcemanager.machinelearning.models.DataType; +import java.util.HashMap; +import java.util.Map; +/** Samples for RegistryDataContainers CreateOrUpdate. */ +public final class RegistryDataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Managed Online Deployment. + * Sample code: CreateOrUpdate Registry Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateManagedOnlineDeployment( + public static void createOrUpdateRegistryDataContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .define("testDeploymentName") - .withRegion("string") - .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") + .registryDataContainers() + .define("string") + .withExistingRegistry("test-rg", "registryName") .withProperties( - new ManagedOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + new DataContainerProperties() .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withReadinessProbe( - new ProbeSettings() - .withFailureThreshold(30) - .withInitialDelay(Duration.parse("PT1S")) - .withPeriod(Duration.parse("PT10S")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT2S"))) - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings())) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withTags(mapOf("string", "string")) + .withIsArchived(false) + .withDataType(DataType.URI_FOLDER)) .create(); } @@ -3152,319 +6674,261 @@ public final class OnlineDeploymentsCreateOrUpdateSamples { } ``` -### OnlineDeployments_Delete +### RegistryDataContainers_Delete ```java -/** Samples for OnlineDeployments Delete. */ -public final class OnlineDeploymentsDeleteSamples { +/** Samples for RegistryDataContainers Delete. */ +public final class RegistryDataContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/delete.json */ /** - * Sample code: Delete Online Deployment. + * Sample code: Delete Registry Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineDeployment( + public static void deleteRegistryDataContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .delete("testrg123", "workspace123", "testEndpoint", "testDeployment", com.azure.core.util.Context.NONE); + manager.registryDataContainers().delete("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_Get +### RegistryDataContainers_Get ```java -/** Samples for OnlineDeployments Get. */ -public final class OnlineDeploymentsGetSamples { - /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json - */ - /** - * Sample code: Get Kubernetes Online Deployment. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void getKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE); - } - +/** Samples for RegistryDataContainers Get. */ +public final class RegistryDataContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/get.json */ /** - * Sample code: Get Managed Online Deployment. + * Sample code: Get Registry Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getManagedOnlineDeployment( + public static void getRegistryDataContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE); + .registryDataContainers() + .getWithResponse("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_GetLogs +### RegistryDataContainers_List ```java -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; +import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** Samples for OnlineDeployments GetLogs. */ -public final class OnlineDeploymentsGetLogsSamples { +/** Samples for RegistryDataContainers List. */ +public final class RegistryDataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/getLogs.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/registryList.json */ /** - * Sample code: Get Online Deployment Logs. + * Sample code: RegistryList Registry Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineDeploymentLogs( + public static void registryListRegistryDataContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .getLogsWithResponse( - "testrg123", - "workspace123", - "testEndpoint", - "testDeployment", - new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(0), - com.azure.core.util.Context.NONE); + .registryDataContainers() + .list("test-rg", "registryName", null, ListViewType.ALL, com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_List +### RegistryDataVersions_CreateOrGetStartPendingUpload ```java -/** Samples for OnlineDeployments List. */ -public final class OnlineDeploymentsListSamples { +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryDataVersions CreateOrGetStartPendingUpload. */ +public final class RegistryDataVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json */ /** - * Sample code: List Online Deployments. + * Sample code: CreateOrGetStartPendingUpload Registry Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineDeployments(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void createOrGetStartPendingUploadRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .list( - "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + .registryDataVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_ListSkus +### RegistryDataVersions_CreateOrUpdate ```java -/** Samples for OnlineDeployments ListSkus. */ -public final class OnlineDeploymentsListSkusSamples { +import com.azure.resourcemanager.machinelearning.models.MLTableData; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryDataVersions CreateOrUpdate. */ +public final class RegistryDataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json */ /** - * Sample code: List Managed Online Deployment Skus. + * Sample code: CreateOrUpdate Registry Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void listManagedOnlineDeploymentSkus( + public static void createOrUpdateRegistryDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, - com.azure.core.util.Context.NONE); + .registryDataVersions() + .define("string") + .withExistingData("test-rg", "registryName", "string") + .withProperties( + new MLTableData() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withDataUri("string") + .withReferencedUris(Arrays.asList("string"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } +} +``` + +### RegistryDataVersions_Delete +```java +/** Samples for RegistryDataVersions Delete. */ +public final class RegistryDataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/delete.json */ /** - * Sample code: List Kubernetes Online Deployment Skus. + * Sample code: Delete Registry Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void listKubernetesOnlineDeploymentSkus( + public static void deleteRegistryDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, - com.azure.core.util.Context.NONE); + .registryDataVersions() + .delete("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_Update +### RegistryDataVersions_Get ```java -import com.azure.resourcemanager.machinelearning.models.OnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.HashMap; -import java.util.Map; - -/** Samples for OnlineDeployments Update. */ -public final class OnlineDeploymentsUpdateSamples { +/** Samples for RegistryDataVersions Get. */ +public final class RegistryDataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/get.json */ /** - * Sample code: Update Managed Online Deployment. + * Sample code: Get Registry Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void updateManagedOnlineDeployment( + public static void getRegistryDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) - .apply(); + manager + .registryDataVersions() + .getWithResponse("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); } +} +``` + +### RegistryDataVersions_List +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for RegistryDataVersions List. */ +public final class RegistryDataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/registryList.json */ /** - * Sample code: Update Kubernetes Online Deployment. + * Sample code: RegistryList Registry Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void updateKubernetesOnlineDeployment( + public static void registryListRegistryDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + manager + .registryDataVersions() + .list( + "test-rg", + "registryName", + "string", + "string", + 1, + null, + "string", + ListViewType.ARCHIVED_ONLY, + com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_CreateOrUpdate +### RegistryEnvironmentContainers_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints CreateOrUpdate. */ -public final class OnlineEndpointsCreateOrUpdateSamples { +/** Samples for RegistryEnvironmentContainers CreateOrUpdate. */ +public final class RegistryEnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Online Endpoint. + * Sample code: CreateOrUpdate Registry Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateOnlineEndpoint( + public static void createOrUpdateRegistryEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .define("testEndpointName") - .withRegion("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") + .registryEnvironmentContainers() + .define("testEnvironment") + .withExistingRegistry("testrg123", "testregistry") .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) + new EnvironmentContainerProperties() .withDescription("string") - .withProperties(mapOf("string", "string")) - .withCompute("string") - .withTraffic(mapOf("string", 1))) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) .create(); } @@ -3481,198 +6945,235 @@ public final class OnlineEndpointsCreateOrUpdateSamples { } ``` -### OnlineEndpoints_Delete +### RegistryEnvironmentContainers_Delete ```java -/** Samples for OnlineEndpoints Delete. */ -public final class OnlineEndpointsDeleteSamples { +/** Samples for RegistryEnvironmentContainers Delete. */ +public final class RegistryEnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Online Endpoint. + * Sample code: Delete Registry Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + .registryEnvironmentContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_Get +### RegistryEnvironmentContainers_Get ```java -/** Samples for OnlineEndpoints Get. */ -public final class OnlineEndpointsGetSamples { +/** Samples for RegistryEnvironmentContainers Get. */ +public final class RegistryEnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/get.json */ /** - * Sample code: Get Online Endpoint. + * Sample code: Get Registry Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + .registryEnvironmentContainers() + .getWithResponse("testrg123", "testregistry", "testEnvironment", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_GetToken +### RegistryEnvironmentContainers_List ```java -/** Samples for OnlineEndpoints GetToken. */ -public final class OnlineEndpointsGetTokenSamples { +/** Samples for RegistryEnvironmentContainers List. */ +public final class RegistryEnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/getToken.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/list.json */ /** - * Sample code: GetToken Online Endpoint. + * Sample code: List Registry Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getTokenOnlineEndpoint( + public static void listRegistryEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + .registryEnvironmentContainers() + .list("testrg123", "testregistry", null, null, com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_List +### RegistryEnvironmentVersions_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.EndpointComputeType; -import com.azure.resourcemanager.machinelearning.models.OrderString; +import com.azure.resourcemanager.machinelearning.models.BuildContext; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; +import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; +import com.azure.resourcemanager.machinelearning.models.Route; +import java.util.HashMap; +import java.util.Map; -/** Samples for OnlineEndpoints List. */ -public final class OnlineEndpointsListSamples { +/** Samples for RegistryEnvironmentVersions CreateOrUpdate. */ +public final class RegistryEnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: List Online Endpoint. + * Sample code: CreateOrUpdate Registry Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void createOrUpdateRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .list( - "test-rg", - "my-aml-workspace", - "string", - 1, - EndpointComputeType.MANAGED, - null, - "string", - "string", - OrderString.CREATED_AT_DESC, - com.azure.core.util.Context.NONE); + .registryEnvironmentVersions() + .define("string") + .withExistingEnvironment("test-rg", "my-aml-registry", "string") + .withProperties( + new EnvironmentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild( + new BuildContext() + .withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties() + .withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### OnlineEndpoints_ListKeys +### RegistryEnvironmentVersions_Delete ```java -/** Samples for OnlineEndpoints ListKeys. */ -public final class OnlineEndpointsListKeysSamples { +/** Samples for RegistryEnvironmentVersions Delete. */ +public final class RegistryEnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/delete.json */ /** - * Sample code: ListKeys Online Endpoint. + * Sample code: Delete Registry Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysOnlineEndpoint( + public static void deleteRegistryEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + .registryEnvironmentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_RegenerateKeys +### RegistryEnvironmentVersions_Get ```java -import com.azure.resourcemanager.machinelearning.models.KeyType; -import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; - -/** Samples for OnlineEndpoints RegenerateKeys. */ -public final class OnlineEndpointsRegenerateKeysSamples { +/** Samples for RegistryEnvironmentVersions Get. */ +public final class RegistryEnvironmentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/regenerateKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/get.json */ /** - * Sample code: RegenerateKeys Online Endpoint. + * Sample code: Get Registry Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void regenerateKeysOnlineEndpoint( + public static void getRegistryEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .onlineEndpoints() - .regenerateKeys( - "test-rg", - "my-aml-workspace", - "testEndpointName", - new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + .registryEnvironmentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_Update +### RegistryEnvironmentVersions_List ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpoint; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import java.io.IOException; +/** Samples for RegistryEnvironmentVersions List. */ +public final class RegistryEnvironmentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/list.json + */ + /** + * Sample code: List Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentVersions() + .list( + "test-rg", + "my-aml-regsitry", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RegistryModelContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints Update. */ -public final class OnlineEndpointsUpdateSamples { +/** Samples for RegistryModelContainers CreateOrUpdate. */ +public final class RegistryModelContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/createOrUpdate.json */ /** - * Sample code: Update Online Endpoint. + * Sample code: CreateOrUpdate Registry Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void updateOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - OnlineEndpoint resource = - manager - .onlineEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .apply(); + public static void createOrUpdateRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "registry123") + .withProperties( + new ModelContainerProperties() + .withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); } @SuppressWarnings("unchecked") @@ -3688,203 +7189,301 @@ public final class OnlineEndpointsUpdateSamples { } ``` -### Operations_List +### RegistryModelContainers_Delete ```java -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** Samples for RegistryModelContainers Delete. */ +public final class RegistryModelContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/operationsList.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/delete.json */ /** - * Sample code: OperationsList. + * Sample code: Delete Registry Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void operationsList(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void deleteRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .delete("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_CreateOrUpdate +### RegistryModelContainers_Get ```java -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; +/** Samples for RegistryModelContainers Get. */ +public final class RegistryModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/get.json + */ + /** + * Sample code: Get Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .getWithResponse("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ -public final class PrivateEndpointConnectionsCreateOrUpdateSamples { +### RegistryModelContainers_List + +```java +/** Samples for RegistryModelContainers List. */ +public final class RegistryModelContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/list.json */ /** - * Sample code: WorkspacePutPrivateEndpointConnection. + * Sample code: List Registry Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void workspacePutPrivateEndpointConnection( + public static void listRegistryModelContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .privateEndpointConnections() - .define("{privateEndpointConnectionName}") - .withExistingWorkspace("rg-1234", "testworkspace") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Auto-Approved")) - .create(); + .registryModelContainers() + .list("testrg123", "registry123", null, null, com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Delete +### RegistryModelVersions_CreateOrGetStartPendingUpload ```java -/** Samples for PrivateEndpointConnections Delete. */ -public final class PrivateEndpointConnectionsDeleteSamples { +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryModelVersions CreateOrGetStartPendingUpload. */ +public final class RegistryModelVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json */ /** - * Sample code: WorkspaceDeletePrivateEndpointConnection. + * Sample code: CreateOrGetStartPendingUpload Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceDeletePrivateEndpointConnection( + public static void createOrGetStartPendingUploadRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .privateEndpointConnections() - .deleteWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + .registryModelVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Get +### RegistryModelVersions_CreateOrUpdate ```java -/** Samples for PrivateEndpointConnections Get. */ -public final class PrivateEndpointConnectionsGetSamples { +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryModelVersions CreateOrUpdate. */ +public final class RegistryModelVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/createOrUpdate.json */ /** - * Sample code: WorkspaceGetPrivateEndpointConnection. + * Sample code: CreateOrUpdate Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceGetPrivateEndpointConnection( + public static void createOrUpdateRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .privateEndpointConnections() - .getWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + .registryModelVersions() + .define("string") + .withExistingModel("test-rg", "my-aml-registry", "string") + .withProperties( + new ModelVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### PrivateEndpointConnections_List +### RegistryModelVersions_Delete ```java -/** Samples for PrivateEndpointConnections List. */ -public final class PrivateEndpointConnectionsListSamples { +/** Samples for RegistryModelVersions Delete. */ +public final class RegistryModelVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/delete.json */ /** - * Sample code: StorageAccountListPrivateEndpointConnections. + * Sample code: Delete Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void storageAccountListPrivateEndpointConnections( + public static void deleteRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.privateEndpointConnections().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager + .registryModelVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResources_List +### RegistryModelVersions_Get ```java -/** Samples for PrivateLinkResources List. */ -public final class PrivateLinkResourcesListSamples { +/** Samples for RegistryModelVersions Get. */ +public final class RegistryModelVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateLinkResource/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/get.json */ /** - * Sample code: WorkspaceListPrivateLinkResources. + * Sample code: Get Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceListPrivateLinkResources( + public static void getRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.privateLinkResources().listWithResponse("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager + .registryModelVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### Quotas_List +### RegistryModelVersions_List ```java -/** Samples for Quotas List. */ -public final class QuotasListSamples { +/** Samples for RegistryModelVersions List. */ +public final class RegistryModelVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/list.json */ /** - * Sample code: List workspace quotas by VMFamily. + * Sample code: List Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listWorkspaceQuotasByVMFamily( + public static void listRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.quotas().list("eastus", com.azure.core.util.Context.NONE); + manager + .registryModelVersions() + .list( + "test-rg", + "my-aml-registry", + "string", + null, + "string", + 1, + "string", + "string", + "string", + "string", + null, + com.azure.core.util.Context.NONE); } } ``` -### Quotas_Update +### RegistryModelVersions_PackageMethod ```java -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; +import com.azure.resourcemanager.machinelearning.models.AzureMLBatchInferencingServer; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentId; +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageInputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PackageInputPathUrl; +import com.azure.resourcemanager.machinelearning.models.PackageInputType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; -/** Samples for Quotas Update. */ -public final class QuotasUpdateSamples { +/** Samples for RegistryModelVersions PackageMethod. */ +public final class RegistryModelVersionsPackageMethodSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/package.json */ /** - * Sample code: update quotas. + * Sample code: Package Registry Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void updateQuotas(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void packageRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager - .quotas() - .updateWithResponse( - "eastus", - new QuotaUpdateParameters() - .withValue( + .registryModelVersions() + .packageMethod( + "test-rg", + "my-aml-registry", + "string", + "string", + new PackageRequest() + .withBaseEnvironmentSource(new BaseEnvironmentId().withResourceId("string")) + .withEnvironmentVariables(mapOf("string", "string")) + .withInferencingServer( + new AzureMLBatchInferencingServer() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string"))) + .withInputs( Arrays .asList( - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(100L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(200L) - .withUnit(QuotaUnit.COUNT))), + new ModelPackageInput() + .withInputType(PackageInputType.URI_FILE) + .withMode(PackageInputDeliveryMode.DOWNLOAD) + .withMountPath("string") + .withPath(new PackageInputPathUrl().withUrl("string")))) + .withModelConfiguration( + new ModelConfiguration() + .withMode(PackageInputDeliveryMode.fromString("ReadOnlyMount")) + .withMountPath("string")) + .withTags(mapOf("string", "string")) + .withTargetEnvironmentId("string"), com.azure.core.util.Context.NONE); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -3903,7 +7502,7 @@ import java.util.Map; /** Samples for Schedules CreateOrUpdate. */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Schedule. @@ -3960,7 +7559,7 @@ public final class SchedulesCreateOrUpdateSamples { /** Samples for Schedules Delete. */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/delete.json */ /** * Sample code: Delete Schedule. @@ -3979,7 +7578,7 @@ public final class SchedulesDeleteSamples { /** Samples for Schedules Get. */ public final class SchedulesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/get.json */ /** * Sample code: Get Schedule. @@ -3998,7 +7597,7 @@ public final class SchedulesGetSamples { /** Samples for Schedules List. */ public final class SchedulesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/list.json */ /** * Sample code: List Schedules. @@ -4017,7 +7616,7 @@ public final class SchedulesListSamples { /** Samples for Usages List. */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Usage/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Usage/list.json */ /** * Sample code: List Usages. @@ -4036,7 +7635,7 @@ public final class UsagesListSamples { /** Samples for VirtualMachineSizes List. */ public final class VirtualMachineSizesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/VirtualMachineSize/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/VirtualMachineSize/list.json */ /** * Sample code: List VM Sizes. @@ -4054,11 +7653,12 @@ public final class VirtualMachineSizesListSamples { ```java import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; +import java.time.OffsetDateTime; /** Samples for WorkspaceConnections Create. */ public final class WorkspaceConnectionsCreateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/create.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. @@ -4074,6 +7674,7 @@ public final class WorkspaceConnectionsCreateSamples { .withProperties( new NoneAuthTypeWorkspaceConnectionProperties() .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) .withTarget("www.facebook.com")) .create(); } @@ -4086,7 +7687,7 @@ public final class WorkspaceConnectionsCreateSamples { /** Samples for WorkspaceConnections Delete. */ public final class WorkspaceConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/delete.json */ /** * Sample code: DeleteWorkspaceConnection. @@ -4108,7 +7709,7 @@ public final class WorkspaceConnectionsDeleteSamples { /** Samples for WorkspaceConnections Get. */ public final class WorkspaceConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/get.json */ /** * Sample code: GetWorkspaceConnection. @@ -4130,7 +7731,7 @@ public final class WorkspaceConnectionsGetSamples { /** Samples for WorkspaceConnections List. */ public final class WorkspaceConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/list.json */ /** * Sample code: ListWorkspaceConnections. @@ -4151,13 +7752,84 @@ public final class WorkspaceConnectionsListSamples { } ``` +### WorkspaceConnections_ListSecrets + +```java +/** Samples for WorkspaceConnections ListSecrets. */ +public final class WorkspaceConnectionsListSecretsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/listSecrets.json + */ + /** + * Sample code: GetWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .workspaceConnections() + .listSecretsWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} +``` + +### WorkspaceConnections_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.AccessKeyAuthTypeWorkspaceConnectionProperties; +import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionAccessKey; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** Samples for WorkspaceConnections Update. */ +public final class WorkspaceConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/update.json + */ + /** + * Sample code: UpdateWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + WorkspaceConnectionPropertiesV2BasicResource resource = + manager + .workspaceConnections() + .getWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AccessKeyAuthTypeWorkspaceConnectionProperties() + .withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withTarget("some_string") + .withCredentials( + new WorkspaceConnectionAccessKey() + .withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); + } +} +``` + ### WorkspaceFeatures_List ```java /** Samples for WorkspaceFeatures List. */ public final class WorkspaceFeaturesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceFeature/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceFeature/list.json */ /** * Sample code: List Workspace features. @@ -4173,13 +7845,13 @@ public final class WorkspaceFeaturesListSamples { ### Workspaces_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.EncryptionKeyVaultProperties; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; import com.azure.resourcemanager.machinelearning.models.EncryptionStatus; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.IdentityForCmk; +import com.azure.resourcemanager.machinelearning.models.KeyVaultProperties; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; import java.util.Arrays; @@ -4189,7 +7861,7 @@ import java.util.Map; /** Samples for Workspaces CreateOrUpdate. */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/create.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. @@ -4209,39 +7881,39 @@ public final class WorkspacesCreateOrUpdateSamples { mapOf( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", new UserAssignedIdentity()))) - .withDescription("test description") - .withFriendlyName("HelloName") - .withKeyVault( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv") .withApplicationInsights( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights") .withContainerRegistry( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry") - .withStorageAccount( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") + .withDescription("test description") .withEncryption( new EncryptionProperty() - .withStatus(EncryptionStatus.ENABLED) .withIdentity( new IdentityForCmk() .withUserAssignedIdentity( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) .withKeyVaultProperties( - new EncryptionKeyVaultProperties() - .withKeyVaultArmId("fakeTokenPlaceholder") + new KeyVaultProperties() + .withIdentityClientId("") .withKeyIdentifier("fakeTokenPlaceholder") - .withIdentityClientId(""))) + .withKeyVaultArmId("fakeTokenPlaceholder")) + .withStatus(EncryptionStatus.ENABLED)) + .withFriendlyName("HelloName") .withHbiWorkspace(false) + .withKeyVault( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv") .withSharedPrivateLinkResources( Arrays .asList( new SharedPrivateLinkResource() .withName("testdbresource") + .withGroupId("Sql") .withPrivateLinkResourceId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") - .withGroupId("Sql") .withRequestMessage("Please approve") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) + .withStatus(EndpointServiceConnectionStatus.APPROVED))) + .withStorageAccount( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") .create(); } @@ -4264,7 +7936,7 @@ public final class WorkspacesCreateOrUpdateSamples { /** Samples for Workspaces Delete. */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. @@ -4272,7 +7944,7 @@ public final class WorkspacesDeleteSamples { * @param manager Entry point to MachineLearningManager. */ public static void deleteWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().delete("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces().delete("workspace-1234", "testworkspace", null, com.azure.core.util.Context.NONE); } } ``` @@ -4288,7 +7960,7 @@ import java.util.Map; /** Samples for Workspaces Diagnose. */ public final class WorkspacesDiagnoseSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/diagnose.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. @@ -4304,15 +7976,15 @@ public final class WorkspacesDiagnoseSamples { new DiagnoseWorkspaceParameters() .withValue( new DiagnoseRequestProperties() - .withUdr(mapOf()) + .withApplicationInsights(mapOf()) + .withContainerRegistry(mapOf()) + .withDnsResolution(mapOf()) + .withKeyVault(mapOf()) .withNsg(mapOf()) + .withOthers(mapOf()) .withResourceLock(mapOf()) - .withDnsResolution(mapOf()) .withStorageAccount(mapOf()) - .withKeyVault(mapOf()) - .withContainerRegistry(mapOf()) - .withApplicationInsights(mapOf()) - .withOthers(mapOf())), + .withUdr(mapOf())), com.azure.core.util.Context.NONE); } @@ -4335,7 +8007,7 @@ public final class WorkspacesDiagnoseSamples { /** Samples for Workspaces GetByResourceGroup. */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/get.json */ /** * Sample code: Get Workspace. @@ -4356,7 +8028,7 @@ public final class WorkspacesGetByResourceGroupSamples { /** Samples for Workspaces List. */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listBySubscription.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. @@ -4365,7 +8037,7 @@ public final class WorkspacesListSamples { */ public static void getWorkspacesBySubscription( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().list(null, com.azure.core.util.Context.NONE); + manager.workspaces().list(null, null, com.azure.core.util.Context.NONE); } } ``` @@ -4376,7 +8048,7 @@ public final class WorkspacesListSamples { /** Samples for Workspaces ListByResourceGroup. */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listByResourceGroup.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. @@ -4385,7 +8057,7 @@ public final class WorkspacesListByResourceGroupSamples { */ public static void getWorkspacesByResourceGroup( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().listByResourceGroup("workspace-1234", null, com.azure.core.util.Context.NONE); + manager.workspaces().listByResourceGroup("workspace-1234", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -4396,7 +8068,7 @@ public final class WorkspacesListByResourceGroupSamples { /** Samples for Workspaces ListKeys. */ public final class WorkspacesListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listKeys.json */ /** * Sample code: List Workspace Keys. @@ -4415,7 +8087,7 @@ public final class WorkspacesListKeysSamples { /** Samples for Workspaces ListNotebookAccessToken. */ public final class WorkspacesListNotebookAccessTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listNotebookAccessToken.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listNotebookAccessToken.json */ /** * Sample code: List Workspace Keys. @@ -4436,7 +8108,7 @@ public final class WorkspacesListNotebookAccessTokenSamples { /** Samples for Workspaces ListNotebookKeys. */ public final class WorkspacesListNotebookKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Notebook/listKeys.json */ /** * Sample code: List Workspace Keys. @@ -4457,7 +8129,7 @@ public final class WorkspacesListNotebookKeysSamples { /** Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. */ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ExternalFQDN/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ExternalFQDN/get.json */ /** * Sample code: ListOutboundNetworkDependenciesEndpoints. @@ -4480,7 +8152,7 @@ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { /** Samples for Workspaces ListStorageAccountKeys. */ public final class WorkspacesListStorageAccountKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listStorageAccountKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listStorageAccountKeys.json */ /** * Sample code: List Workspace Keys. @@ -4501,7 +8173,7 @@ public final class WorkspacesListStorageAccountKeysSamples { /** Samples for Workspaces PrepareNotebook. */ public final class WorkspacesPrepareNotebookSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/prepare.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Notebook/prepare.json */ /** * Sample code: Prepare Notebook. @@ -4520,7 +8192,7 @@ public final class WorkspacesPrepareNotebookSamples { /** Samples for Workspaces ResyncKeys. */ public final class WorkspacesResyncKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/resyncKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/resyncKeys.json */ /** * Sample code: Resync Workspace Keys. @@ -4536,13 +8208,13 @@ public final class WorkspacesResyncKeysSamples { ### Workspaces_Update ```java -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.Workspace; /** Samples for Workspaces Update. */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. @@ -4559,7 +8231,7 @@ public final class WorkspacesUpdateSamples { .update() .withDescription("new description") .withFriendlyName("New friendly name") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED) .apply(); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml index 9a58e2922f636..3723143b5fb57 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Machine Learning Management - This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2022-10. + This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2023-08. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java index a212fe3e6c4a3..32a88d0b812e7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java @@ -23,8 +23,8 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningWorkspaces; -import com.azure.resourcemanager.machinelearning.implementation.AzureMachineLearningWorkspacesBuilder; +import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningServices; +import com.azure.resourcemanager.machinelearning.implementation.AzureMachineLearningServicesBuilder; import com.azure.resourcemanager.machinelearning.implementation.BatchDeploymentsImpl; import com.azure.resourcemanager.machinelearning.implementation.BatchEndpointsImpl; import com.azure.resourcemanager.machinelearning.implementation.CodeContainersImpl; @@ -37,7 +37,15 @@ import com.azure.resourcemanager.machinelearning.implementation.DatastoresImpl; import com.azure.resourcemanager.machinelearning.implementation.EnvironmentContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.EnvironmentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesetContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesetVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.JobsImpl; +import com.azure.resourcemanager.machinelearning.implementation.LabelingJobsImpl; +import com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkProvisionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkSettingsRulesImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.OnlineDeploymentsImpl; @@ -46,6 +54,17 @@ import com.azure.resourcemanager.machinelearning.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.machinelearning.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.machinelearning.implementation.QuotasImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistriesImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryCodeContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryCodeVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryComponentContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryComponentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryDataContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryDataVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryModelContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryModelVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.SchedulesImpl; import com.azure.resourcemanager.machinelearning.implementation.UsagesImpl; import com.azure.resourcemanager.machinelearning.implementation.VirtualMachineSizesImpl; @@ -64,7 +83,15 @@ import com.azure.resourcemanager.machinelearning.models.Datastores; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainers; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersions; +import com.azure.resourcemanager.machinelearning.models.Features; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainers; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersions; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainers; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersions; import com.azure.resourcemanager.machinelearning.models.Jobs; +import com.azure.resourcemanager.machinelearning.models.LabelingJobs; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisions; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettingsRules; import com.azure.resourcemanager.machinelearning.models.ModelContainers; import com.azure.resourcemanager.machinelearning.models.ModelVersions; import com.azure.resourcemanager.machinelearning.models.OnlineDeployments; @@ -73,6 +100,17 @@ import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnections; import com.azure.resourcemanager.machinelearning.models.PrivateLinkResources; import com.azure.resourcemanager.machinelearning.models.Quotas; +import com.azure.resourcemanager.machinelearning.models.Registries; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryDataContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryDataVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryModelContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryModelVersions; import com.azure.resourcemanager.machinelearning.models.Schedules; import com.azure.resourcemanager.machinelearning.models.Usages; import com.azure.resourcemanager.machinelearning.models.VirtualMachineSizes; @@ -91,10 +129,6 @@ * resources. */ public final class MachineLearningManager { - private Operations operations; - - private Workspaces workspaces; - private Usages usages; private VirtualMachineSizes virtualMachineSizes; @@ -103,11 +137,25 @@ public final class MachineLearningManager { private Computes computes; - private PrivateEndpointConnections privateEndpointConnections; + private RegistryCodeContainers registryCodeContainers; - private PrivateLinkResources privateLinkResources; + private RegistryCodeVersions registryCodeVersions; - private WorkspaceConnections workspaceConnections; + private RegistryComponentContainers registryComponentContainers; + + private RegistryComponentVersions registryComponentVersions; + + private RegistryDataContainers registryDataContainers; + + private RegistryDataVersions registryDataVersions; + + private RegistryEnvironmentContainers registryEnvironmentContainers; + + private RegistryEnvironmentVersions registryEnvironmentVersions; + + private RegistryModelContainers registryModelContainers; + + private RegistryModelVersions registryModelVersions; private BatchEndpoints batchEndpoints; @@ -131,8 +179,20 @@ public final class MachineLearningManager { private EnvironmentVersions environmentVersions; + private FeaturesetContainers featuresetContainers; + + private Features features; + + private FeaturesetVersions featuresetVersions; + + private FeaturestoreEntityContainers featurestoreEntityContainers; + + private FeaturestoreEntityVersions featurestoreEntityVersions; + private Jobs jobs; + private LabelingJobs labelingJobs; + private ModelContainers modelContainers; private ModelVersions modelVersions; @@ -143,15 +203,31 @@ public final class MachineLearningManager { private Schedules schedules; + private Registries registries; + private WorkspaceFeatures workspaceFeatures; - private final AzureMachineLearningWorkspaces clientObject; + private Operations operations; + + private Workspaces workspaces; + + private WorkspaceConnections workspaceConnections; + + private ManagedNetworkSettingsRules managedNetworkSettingsRules; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private ManagedNetworkProvisions managedNetworkProvisions; + + private final AzureMachineLearningServices clientObject; private MachineLearningManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = - new AzureMachineLearningWorkspacesBuilder() + new AzureMachineLearningServicesBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) @@ -310,7 +386,7 @@ public MachineLearningManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.machinelearning") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -367,30 +443,6 @@ public MachineLearningManager authenticate(TokenCredential credential, AzureProf } } - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of Workspaces. It manages Workspace. - * - * @return Resource collection API of Workspaces. - */ - public Workspaces workspaces() { - if (this.workspaces == null) { - this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); - } - return workspaces; - } - /** * Gets the resource collection API of Usages. * @@ -440,41 +492,130 @@ public Computes computes() { } /** - * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * Gets the resource collection API of RegistryCodeContainers. It manages CodeContainer. * - * @return Resource collection API of PrivateEndpointConnections. + * @return Resource collection API of RegistryCodeContainers. */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + public RegistryCodeContainers registryCodeContainers() { + if (this.registryCodeContainers == null) { + this.registryCodeContainers = + new RegistryCodeContainersImpl(clientObject.getRegistryCodeContainers(), this); } - return privateEndpointConnections; + return registryCodeContainers; } /** - * Gets the resource collection API of PrivateLinkResources. + * Gets the resource collection API of RegistryCodeVersions. It manages CodeVersion. * - * @return Resource collection API of PrivateLinkResources. + * @return Resource collection API of RegistryCodeVersions. */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + public RegistryCodeVersions registryCodeVersions() { + if (this.registryCodeVersions == null) { + this.registryCodeVersions = new RegistryCodeVersionsImpl(clientObject.getRegistryCodeVersions(), this); } - return privateLinkResources; + return registryCodeVersions; } /** - * Gets the resource collection API of WorkspaceConnections. It manages - * WorkspaceConnectionPropertiesV2BasicResource. + * Gets the resource collection API of RegistryComponentContainers. It manages ComponentContainer. * - * @return Resource collection API of WorkspaceConnections. + * @return Resource collection API of RegistryComponentContainers. */ - public WorkspaceConnections workspaceConnections() { - if (this.workspaceConnections == null) { - this.workspaceConnections = new WorkspaceConnectionsImpl(clientObject.getWorkspaceConnections(), this); + public RegistryComponentContainers registryComponentContainers() { + if (this.registryComponentContainers == null) { + this.registryComponentContainers = + new RegistryComponentContainersImpl(clientObject.getRegistryComponentContainers(), this); } - return workspaceConnections; + return registryComponentContainers; + } + + /** + * Gets the resource collection API of RegistryComponentVersions. It manages ComponentVersion. + * + * @return Resource collection API of RegistryComponentVersions. + */ + public RegistryComponentVersions registryComponentVersions() { + if (this.registryComponentVersions == null) { + this.registryComponentVersions = + new RegistryComponentVersionsImpl(clientObject.getRegistryComponentVersions(), this); + } + return registryComponentVersions; + } + + /** + * Gets the resource collection API of RegistryDataContainers. It manages DataContainer. + * + * @return Resource collection API of RegistryDataContainers. + */ + public RegistryDataContainers registryDataContainers() { + if (this.registryDataContainers == null) { + this.registryDataContainers = + new RegistryDataContainersImpl(clientObject.getRegistryDataContainers(), this); + } + return registryDataContainers; + } + + /** + * Gets the resource collection API of RegistryDataVersions. It manages DataVersionBase. + * + * @return Resource collection API of RegistryDataVersions. + */ + public RegistryDataVersions registryDataVersions() { + if (this.registryDataVersions == null) { + this.registryDataVersions = new RegistryDataVersionsImpl(clientObject.getRegistryDataVersions(), this); + } + return registryDataVersions; + } + + /** + * Gets the resource collection API of RegistryEnvironmentContainers. It manages EnvironmentContainer. + * + * @return Resource collection API of RegistryEnvironmentContainers. + */ + public RegistryEnvironmentContainers registryEnvironmentContainers() { + if (this.registryEnvironmentContainers == null) { + this.registryEnvironmentContainers = + new RegistryEnvironmentContainersImpl(clientObject.getRegistryEnvironmentContainers(), this); + } + return registryEnvironmentContainers; + } + + /** + * Gets the resource collection API of RegistryEnvironmentVersions. It manages EnvironmentVersion. + * + * @return Resource collection API of RegistryEnvironmentVersions. + */ + public RegistryEnvironmentVersions registryEnvironmentVersions() { + if (this.registryEnvironmentVersions == null) { + this.registryEnvironmentVersions = + new RegistryEnvironmentVersionsImpl(clientObject.getRegistryEnvironmentVersions(), this); + } + return registryEnvironmentVersions; + } + + /** + * Gets the resource collection API of RegistryModelContainers. It manages ModelContainer. + * + * @return Resource collection API of RegistryModelContainers. + */ + public RegistryModelContainers registryModelContainers() { + if (this.registryModelContainers == null) { + this.registryModelContainers = + new RegistryModelContainersImpl(clientObject.getRegistryModelContainers(), this); + } + return registryModelContainers; + } + + /** + * Gets the resource collection API of RegistryModelVersions. It manages ModelVersion. + * + * @return Resource collection API of RegistryModelVersions. + */ + public RegistryModelVersions registryModelVersions() { + if (this.registryModelVersions == null) { + this.registryModelVersions = new RegistryModelVersionsImpl(clientObject.getRegistryModelVersions(), this); + } + return registryModelVersions; } /** @@ -502,7 +643,7 @@ public BatchDeployments batchDeployments() { } /** - * Gets the resource collection API of CodeContainers. It manages CodeContainer. + * Gets the resource collection API of CodeContainers. * * @return Resource collection API of CodeContainers. */ @@ -514,7 +655,7 @@ public CodeContainers codeContainers() { } /** - * Gets the resource collection API of CodeVersions. It manages CodeVersion. + * Gets the resource collection API of CodeVersions. * * @return Resource collection API of CodeVersions. */ @@ -526,7 +667,7 @@ public CodeVersions codeVersions() { } /** - * Gets the resource collection API of ComponentContainers. It manages ComponentContainer. + * Gets the resource collection API of ComponentContainers. * * @return Resource collection API of ComponentContainers. */ @@ -538,7 +679,7 @@ public ComponentContainers componentContainers() { } /** - * Gets the resource collection API of ComponentVersions. It manages ComponentVersion. + * Gets the resource collection API of ComponentVersions. * * @return Resource collection API of ComponentVersions. */ @@ -550,7 +691,7 @@ public ComponentVersions componentVersions() { } /** - * Gets the resource collection API of DataContainers. It manages DataContainer. + * Gets the resource collection API of DataContainers. * * @return Resource collection API of DataContainers. */ @@ -562,7 +703,7 @@ public DataContainers dataContainers() { } /** - * Gets the resource collection API of DataVersions. It manages DataVersionBase. + * Gets the resource collection API of DataVersions. * * @return Resource collection API of DataVersions. */ @@ -586,7 +727,7 @@ public Datastores datastores() { } /** - * Gets the resource collection API of EnvironmentContainers. It manages EnvironmentContainer. + * Gets the resource collection API of EnvironmentContainers. * * @return Resource collection API of EnvironmentContainers. */ @@ -598,7 +739,7 @@ public EnvironmentContainers environmentContainers() { } /** - * Gets the resource collection API of EnvironmentVersions. It manages EnvironmentVersion. + * Gets the resource collection API of EnvironmentVersions. * * @return Resource collection API of EnvironmentVersions. */ @@ -609,6 +750,68 @@ public EnvironmentVersions environmentVersions() { return environmentVersions; } + /** + * Gets the resource collection API of FeaturesetContainers. It manages FeaturesetContainer. + * + * @return Resource collection API of FeaturesetContainers. + */ + public FeaturesetContainers featuresetContainers() { + if (this.featuresetContainers == null) { + this.featuresetContainers = new FeaturesetContainersImpl(clientObject.getFeaturesetContainers(), this); + } + return featuresetContainers; + } + + /** + * Gets the resource collection API of Features. + * + * @return Resource collection API of Features. + */ + public Features features() { + if (this.features == null) { + this.features = new FeaturesImpl(clientObject.getFeatures(), this); + } + return features; + } + + /** + * Gets the resource collection API of FeaturesetVersions. It manages FeaturesetVersion. + * + * @return Resource collection API of FeaturesetVersions. + */ + public FeaturesetVersions featuresetVersions() { + if (this.featuresetVersions == null) { + this.featuresetVersions = new FeaturesetVersionsImpl(clientObject.getFeaturesetVersions(), this); + } + return featuresetVersions; + } + + /** + * Gets the resource collection API of FeaturestoreEntityContainers. It manages FeaturestoreEntityContainer. + * + * @return Resource collection API of FeaturestoreEntityContainers. + */ + public FeaturestoreEntityContainers featurestoreEntityContainers() { + if (this.featurestoreEntityContainers == null) { + this.featurestoreEntityContainers = + new FeaturestoreEntityContainersImpl(clientObject.getFeaturestoreEntityContainers(), this); + } + return featurestoreEntityContainers; + } + + /** + * Gets the resource collection API of FeaturestoreEntityVersions. It manages FeaturestoreEntityVersion. + * + * @return Resource collection API of FeaturestoreEntityVersions. + */ + public FeaturestoreEntityVersions featurestoreEntityVersions() { + if (this.featurestoreEntityVersions == null) { + this.featurestoreEntityVersions = + new FeaturestoreEntityVersionsImpl(clientObject.getFeaturestoreEntityVersions(), this); + } + return featurestoreEntityVersions; + } + /** * Gets the resource collection API of Jobs. It manages JobBase. * @@ -622,7 +825,19 @@ public Jobs jobs() { } /** - * Gets the resource collection API of ModelContainers. It manages ModelContainer. + * Gets the resource collection API of LabelingJobs. It manages LabelingJob. + * + * @return Resource collection API of LabelingJobs. + */ + public LabelingJobs labelingJobs() { + if (this.labelingJobs == null) { + this.labelingJobs = new LabelingJobsImpl(clientObject.getLabelingJobs(), this); + } + return labelingJobs; + } + + /** + * Gets the resource collection API of ModelContainers. * * @return Resource collection API of ModelContainers. */ @@ -634,7 +849,7 @@ public ModelContainers modelContainers() { } /** - * Gets the resource collection API of ModelVersions. It manages ModelVersion. + * Gets the resource collection API of ModelVersions. * * @return Resource collection API of ModelVersions. */ @@ -681,6 +896,18 @@ public Schedules schedules() { return schedules; } + /** + * Gets the resource collection API of Registries. It manages Registry. + * + * @return Resource collection API of Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(clientObject.getRegistries(), this); + } + return registries; + } + /** * Gets the resource collection API of WorkspaceFeatures. * @@ -694,10 +921,98 @@ public WorkspaceFeatures workspaceFeatures() { } /** - * @return Wrapped service client AzureMachineLearningWorkspaces providing direct access to the underlying + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Workspaces. It manages Workspace. + * + * @return Resource collection API of Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; + } + + /** + * Gets the resource collection API of WorkspaceConnections. It manages + * WorkspaceConnectionPropertiesV2BasicResource. + * + * @return Resource collection API of WorkspaceConnections. + */ + public WorkspaceConnections workspaceConnections() { + if (this.workspaceConnections == null) { + this.workspaceConnections = new WorkspaceConnectionsImpl(clientObject.getWorkspaceConnections(), this); + } + return workspaceConnections; + } + + /** + * Gets the resource collection API of ManagedNetworkSettingsRules. It manages OutboundRuleBasicResource. + * + * @return Resource collection API of ManagedNetworkSettingsRules. + */ + public ManagedNetworkSettingsRules managedNetworkSettingsRules() { + if (this.managedNetworkSettingsRules == null) { + this.managedNetworkSettingsRules = + new ManagedNetworkSettingsRulesImpl(clientObject.getManagedNetworkSettingsRules(), this); + } + return managedNetworkSettingsRules; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of ManagedNetworkProvisions. + * + * @return Resource collection API of ManagedNetworkProvisions. + */ + public ManagedNetworkProvisions managedNetworkProvisions() { + if (this.managedNetworkProvisions == null) { + this.managedNetworkProvisions = + new ManagedNetworkProvisionsImpl(clientObject.getManagedNetworkProvisions(), this); + } + return managedNetworkProvisions; + } + + /** + * @return Wrapped service client AzureMachineLearningServices providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. */ - public AzureMachineLearningWorkspaces serviceClient() { + public AzureMachineLearningServices serviceClient() { return this.clientObject; } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java new file mode 100644 index 0000000000000..a498b60cb0acf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureMachineLearningServices class. */ +public interface AzureMachineLearningServices { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + VirtualMachineSizesClient getVirtualMachineSizes(); + + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + QuotasClient getQuotas(); + + /** + * Gets the ComputesClient object to access its operations. + * + * @return the ComputesClient object. + */ + ComputesClient getComputes(); + + /** + * Gets the RegistryCodeContainersClient object to access its operations. + * + * @return the RegistryCodeContainersClient object. + */ + RegistryCodeContainersClient getRegistryCodeContainers(); + + /** + * Gets the RegistryCodeVersionsClient object to access its operations. + * + * @return the RegistryCodeVersionsClient object. + */ + RegistryCodeVersionsClient getRegistryCodeVersions(); + + /** + * Gets the RegistryComponentContainersClient object to access its operations. + * + * @return the RegistryComponentContainersClient object. + */ + RegistryComponentContainersClient getRegistryComponentContainers(); + + /** + * Gets the RegistryComponentVersionsClient object to access its operations. + * + * @return the RegistryComponentVersionsClient object. + */ + RegistryComponentVersionsClient getRegistryComponentVersions(); + + /** + * Gets the RegistryDataContainersClient object to access its operations. + * + * @return the RegistryDataContainersClient object. + */ + RegistryDataContainersClient getRegistryDataContainers(); + + /** + * Gets the RegistryDataVersionsClient object to access its operations. + * + * @return the RegistryDataVersionsClient object. + */ + RegistryDataVersionsClient getRegistryDataVersions(); + + /** + * Gets the RegistryEnvironmentContainersClient object to access its operations. + * + * @return the RegistryEnvironmentContainersClient object. + */ + RegistryEnvironmentContainersClient getRegistryEnvironmentContainers(); + + /** + * Gets the RegistryEnvironmentVersionsClient object to access its operations. + * + * @return the RegistryEnvironmentVersionsClient object. + */ + RegistryEnvironmentVersionsClient getRegistryEnvironmentVersions(); + + /** + * Gets the RegistryModelContainersClient object to access its operations. + * + * @return the RegistryModelContainersClient object. + */ + RegistryModelContainersClient getRegistryModelContainers(); + + /** + * Gets the RegistryModelVersionsClient object to access its operations. + * + * @return the RegistryModelVersionsClient object. + */ + RegistryModelVersionsClient getRegistryModelVersions(); + + /** + * Gets the BatchEndpointsClient object to access its operations. + * + * @return the BatchEndpointsClient object. + */ + BatchEndpointsClient getBatchEndpoints(); + + /** + * Gets the BatchDeploymentsClient object to access its operations. + * + * @return the BatchDeploymentsClient object. + */ + BatchDeploymentsClient getBatchDeployments(); + + /** + * Gets the CodeContainersClient object to access its operations. + * + * @return the CodeContainersClient object. + */ + CodeContainersClient getCodeContainers(); + + /** + * Gets the CodeVersionsClient object to access its operations. + * + * @return the CodeVersionsClient object. + */ + CodeVersionsClient getCodeVersions(); + + /** + * Gets the ComponentContainersClient object to access its operations. + * + * @return the ComponentContainersClient object. + */ + ComponentContainersClient getComponentContainers(); + + /** + * Gets the ComponentVersionsClient object to access its operations. + * + * @return the ComponentVersionsClient object. + */ + ComponentVersionsClient getComponentVersions(); + + /** + * Gets the DataContainersClient object to access its operations. + * + * @return the DataContainersClient object. + */ + DataContainersClient getDataContainers(); + + /** + * Gets the DataVersionsClient object to access its operations. + * + * @return the DataVersionsClient object. + */ + DataVersionsClient getDataVersions(); + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + DatastoresClient getDatastores(); + + /** + * Gets the EnvironmentContainersClient object to access its operations. + * + * @return the EnvironmentContainersClient object. + */ + EnvironmentContainersClient getEnvironmentContainers(); + + /** + * Gets the EnvironmentVersionsClient object to access its operations. + * + * @return the EnvironmentVersionsClient object. + */ + EnvironmentVersionsClient getEnvironmentVersions(); + + /** + * Gets the FeaturesetContainersClient object to access its operations. + * + * @return the FeaturesetContainersClient object. + */ + FeaturesetContainersClient getFeaturesetContainers(); + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + FeaturesClient getFeatures(); + + /** + * Gets the FeaturesetVersionsClient object to access its operations. + * + * @return the FeaturesetVersionsClient object. + */ + FeaturesetVersionsClient getFeaturesetVersions(); + + /** + * Gets the FeaturestoreEntityContainersClient object to access its operations. + * + * @return the FeaturestoreEntityContainersClient object. + */ + FeaturestoreEntityContainersClient getFeaturestoreEntityContainers(); + + /** + * Gets the FeaturestoreEntityVersionsClient object to access its operations. + * + * @return the FeaturestoreEntityVersionsClient object. + */ + FeaturestoreEntityVersionsClient getFeaturestoreEntityVersions(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the LabelingJobsClient object to access its operations. + * + * @return the LabelingJobsClient object. + */ + LabelingJobsClient getLabelingJobs(); + + /** + * Gets the ModelContainersClient object to access its operations. + * + * @return the ModelContainersClient object. + */ + ModelContainersClient getModelContainers(); + + /** + * Gets the ModelVersionsClient object to access its operations. + * + * @return the ModelVersionsClient object. + */ + ModelVersionsClient getModelVersions(); + + /** + * Gets the OnlineEndpointsClient object to access its operations. + * + * @return the OnlineEndpointsClient object. + */ + OnlineEndpointsClient getOnlineEndpoints(); + + /** + * Gets the OnlineDeploymentsClient object to access its operations. + * + * @return the OnlineDeploymentsClient object. + */ + OnlineDeploymentsClient getOnlineDeployments(); + + /** + * Gets the SchedulesClient object to access its operations. + * + * @return the SchedulesClient object. + */ + SchedulesClient getSchedules(); + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + RegistriesClient getRegistries(); + + /** + * Gets the WorkspaceFeaturesClient object to access its operations. + * + * @return the WorkspaceFeaturesClient object. + */ + WorkspaceFeaturesClient getWorkspaceFeatures(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); + + /** + * Gets the WorkspaceConnectionsClient object to access its operations. + * + * @return the WorkspaceConnectionsClient object. + */ + WorkspaceConnectionsClient getWorkspaceConnections(); + + /** + * Gets the ManagedNetworkSettingsRulesClient object to access its operations. + * + * @return the ManagedNetworkSettingsRulesClient object. + */ + ManagedNetworkSettingsRulesClient getManagedNetworkSettingsRules(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + ManagedNetworkProvisionsClient getManagedNetworkProvisions(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java deleted file mode 100644 index e8a40ef9b43c9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for AzureMachineLearningWorkspaces class. */ -public interface AzureMachineLearningWorkspaces { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - WorkspacesClient getWorkspaces(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - VirtualMachineSizesClient getVirtualMachineSizes(); - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - QuotasClient getQuotas(); - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - ComputesClient getComputes(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the WorkspaceConnectionsClient object to access its operations. - * - * @return the WorkspaceConnectionsClient object. - */ - WorkspaceConnectionsClient getWorkspaceConnections(); - - /** - * Gets the BatchEndpointsClient object to access its operations. - * - * @return the BatchEndpointsClient object. - */ - BatchEndpointsClient getBatchEndpoints(); - - /** - * Gets the BatchDeploymentsClient object to access its operations. - * - * @return the BatchDeploymentsClient object. - */ - BatchDeploymentsClient getBatchDeployments(); - - /** - * Gets the CodeContainersClient object to access its operations. - * - * @return the CodeContainersClient object. - */ - CodeContainersClient getCodeContainers(); - - /** - * Gets the CodeVersionsClient object to access its operations. - * - * @return the CodeVersionsClient object. - */ - CodeVersionsClient getCodeVersions(); - - /** - * Gets the ComponentContainersClient object to access its operations. - * - * @return the ComponentContainersClient object. - */ - ComponentContainersClient getComponentContainers(); - - /** - * Gets the ComponentVersionsClient object to access its operations. - * - * @return the ComponentVersionsClient object. - */ - ComponentVersionsClient getComponentVersions(); - - /** - * Gets the DataContainersClient object to access its operations. - * - * @return the DataContainersClient object. - */ - DataContainersClient getDataContainers(); - - /** - * Gets the DataVersionsClient object to access its operations. - * - * @return the DataVersionsClient object. - */ - DataVersionsClient getDataVersions(); - - /** - * Gets the DatastoresClient object to access its operations. - * - * @return the DatastoresClient object. - */ - DatastoresClient getDatastores(); - - /** - * Gets the EnvironmentContainersClient object to access its operations. - * - * @return the EnvironmentContainersClient object. - */ - EnvironmentContainersClient getEnvironmentContainers(); - - /** - * Gets the EnvironmentVersionsClient object to access its operations. - * - * @return the EnvironmentVersionsClient object. - */ - EnvironmentVersionsClient getEnvironmentVersions(); - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - JobsClient getJobs(); - - /** - * Gets the ModelContainersClient object to access its operations. - * - * @return the ModelContainersClient object. - */ - ModelContainersClient getModelContainers(); - - /** - * Gets the ModelVersionsClient object to access its operations. - * - * @return the ModelVersionsClient object. - */ - ModelVersionsClient getModelVersions(); - - /** - * Gets the OnlineEndpointsClient object to access its operations. - * - * @return the OnlineEndpointsClient object. - */ - OnlineEndpointsClient getOnlineEndpoints(); - - /** - * Gets the OnlineDeploymentsClient object to access its operations. - * - * @return the OnlineDeploymentsClient object. - */ - OnlineDeploymentsClient getOnlineDeployments(); - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - SchedulesClient getSchedules(); - - /** - * Gets the WorkspaceFeaturesClient object to access its operations. - * - * @return the WorkspaceFeaturesClient object. - */ - WorkspaceFeaturesClient getWorkspaceFeatures(); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java index fa5b5e3a44693..b619227035501 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java @@ -10,6 +10,8 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; /** An instance of this class provides access to all the operations defined in CodeVersionsClient. */ public interface CodeVersionsClient { @@ -36,6 +38,8 @@ public interface CodeVersionsClient { * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -50,6 +54,8 @@ PagedIterable list( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context); /** @@ -154,4 +160,44 @@ Response createOrUpdateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) CodeVersionInner createOrUpdate( String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java index c1374059eaa05..55ccee820c554 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java @@ -38,6 +38,7 @@ public interface ComponentVersionsClient { * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -53,6 +54,7 @@ PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context); /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java index 5676a642b1704..ea43899804418 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java @@ -13,9 +13,14 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; import com.azure.resourcemanager.machinelearning.models.ClusterUpdateParameters; +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; +import java.util.List; /** An instance of this class provides access to all the operations defined in ComputesClient. */ public interface ComputesClient { @@ -318,6 +323,42 @@ void delete( UnderlyingResourceAction underlyingResourceAction, Context context); + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateCustomServicesWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + List customServices, + Context context); + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void updateCustomServices( + String resourceGroupName, String workspaceName, String computeName, List customServices); + /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. * @@ -552,4 +593,134 @@ SyncPoller, Void> beginRestart( */ @ServiceMethod(returns = ReturnType.SINGLE) void restart(String resourceGroupName, String workspaceName, String computeName, Context context); + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateIdleShutdownSettingWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + IdleShutdownSetting parameters, + Context context); + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void updateIdleShutdownSetting( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters); + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response allowedResizeSizesWithResponse( + String resourceGroupName, String workspaceName, String computeName, Context context); + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineSizeListResultInner allowedResizeSizes( + String resourceGroupName, String workspaceName, String computeName); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resize(String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java index bf43827ba11f0..13f4c1913326c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java @@ -41,6 +41,7 @@ public interface DataVersionsClient { * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,6 +58,7 @@ PagedIterable list( String skip, String tags, ListViewType listViewType, + String stage, Context context); /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java index 9b6667f2237ec..83d15a43c9650 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java @@ -38,6 +38,7 @@ public interface EnvironmentVersionsClient { * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -53,6 +54,7 @@ PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context); /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java new file mode 100644 index 0000000000000..8cb73d4f1468d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; + +/** An instance of this class provides access to all the operations defined in FeaturesClient. */ +public interface FeaturesClient { + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion); + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName, + Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeatureInner get( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java new file mode 100644 index 0000000000000..7a1756fad503c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in FeaturesetContainersClient. */ +public interface FeaturesetContainersClient { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java new file mode 100644 index 0000000000000..c4b4abbbd0f7d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in FeaturesetVersionsClient. */ +public interface FeaturesetVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetJobInner> beginBackfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetJobInner> beginBackfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetJobInner backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetJobInner backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context); + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMaterializationJobs( + String resourceGroupName, String workspaceName, String name, String version); + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMaterializationJobs( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java new file mode 100644 index 0000000000000..17f5cbe9d1925 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in FeaturestoreEntityContainersClient. */ +public interface FeaturestoreEntityContainersClient { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityContainerInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java new file mode 100644 index 0000000000000..c9309a685edad --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in FeaturestoreEntityVersionsClient. */ +public interface FeaturestoreEntityVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java index c4660d91fa818..4b5431d253623 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java @@ -13,6 +13,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PartialJobBasePartialResource; /** An instance of this class provides access to all the operations defined in JobsClient. */ public interface JobsClient { @@ -38,6 +39,9 @@ public interface JobsClient { * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -52,6 +56,9 @@ PagedIterable list( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context); /** @@ -140,6 +147,38 @@ SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.SINGLE) JobBaseInner get(String resourceGroupName, String workspaceName, String id); + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String workspaceName, String id, PartialJobBasePartialResource body, Context context); + + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobBaseInner update(String resourceGroupName, String workspaceName, String id, PartialJobBasePartialResource body); + /** * Creates and executes a Job. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/LabelingJobsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/LabelingJobsClient.java new file mode 100644 index 0000000000000..ade623c677062 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/LabelingJobsClient.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; + +/** An instance of this class provides access to all the operations defined in LabelingJobsClient. */ +public interface LabelingJobsClient { + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context); + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String id); + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories, + Context context); + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabelingJobInner get(String resourceGroupName, String workspaceName, String id); + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabelingJobInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body); + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabelingJobInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context); + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabelingJobInner createOrUpdate(String resourceGroupName, String workspaceName, String id, LabelingJobInner body); + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabelingJobInner createOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportSummaryInner> beginExportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportSummaryInner> beginExportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportSummaryInner exportLabels(String resourceGroupName, String workspaceName, String id, ExportSummaryInner body); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportSummaryInner exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context); + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void pause(String resourceGroupName, String workspaceName, String id); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResume(String resourceGroupName, String workspaceName, String id); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResume( + String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resume(String resourceGroupName, String workspaceName, String id); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resume(String resourceGroupName, String workspaceName, String id, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java new file mode 100644 index 0000000000000..8950519245948 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. */ +public interface ManagedNetworkProvisionsClient { + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java new file mode 100644 index 0000000000000..737dae45384b1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; + +/** An instance of this class provides access to all the operations defined in ManagedNetworkSettingsRulesClient. */ +public interface ManagedNetworkSettingsRulesClient { + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java index 92582d819da13..8defceb879489 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java @@ -8,9 +8,13 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; /** An instance of this class provides access to all the operations defined in ModelVersionsClient. */ public interface ModelVersionsClient { @@ -44,6 +48,7 @@ public interface ModelVersionsClient { * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,6 +70,7 @@ PagedIterable list( String properties, String feed, ListViewType listViewType, + String stage, Context context); /** @@ -169,4 +175,86 @@ Response createOrUpdateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) ModelVersionInner createOrUpdate( String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResponseInner packageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResponseInner packageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java index 8b04958fc924d..392113c0f5231 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java @@ -403,7 +403,7 @@ void regenerateKeys( Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -419,7 +419,7 @@ Response getTokenWithResponse( String resourceGroupName, String workspaceName, String endpointName, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java index 2b613c7f88e3f..6e8c7373dcca2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java @@ -14,7 +14,7 @@ /** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -28,7 +28,7 @@ public interface PrivateEndpointConnectionsClient { PagedIterable list(String resourceGroupName, String workspaceName); /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -43,43 +43,40 @@ public interface PrivateEndpointConnectionsClient { PagedIterable list(String resourceGroupName, String workspaceName, Context context); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( + Response deleteWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -87,58 +84,61 @@ PrivateEndpointConnectionInner get( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context); + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); + PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, + Context context); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java index 1dc6edf69f64a..a21e13df08a05 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java @@ -6,37 +6,44 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; /** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ public interface PrivateLinkResourcesClient { /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace along with {@link Response}. + * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace. + * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceListResultInner list(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java new file mode 100644 index 0000000000000..e3f2ab26fe5a3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public interface RegistriesClient { + /** + * List registries by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body, Context context); + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update(String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, RegistryInner body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginRemoveRegions( + String resourceGroupName, String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginRemoveRegions( + String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java new file mode 100644 index 0000000000000..11209d86d6d59 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; + +/** An instance of this class provides access to all the operations defined in RegistryCodeContainersClient. */ +public interface RegistryCodeContainersClient { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner get(String resourceGroupName, String registryName, String codeName); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java new file mode 100644 index 0000000000000..e918e624ffce1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** An instance of this class provides access to all the operations defined in RegistryCodeVersionsClient. */ +public interface RegistryCodeVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String codeName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner get(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String codeName, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java new file mode 100644 index 0000000000000..11f8512d8b1a5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; + +/** An instance of this class provides access to all the operations defined in RegistryComponentContainersClient. */ +public interface RegistryComponentContainersClient { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner get(String resourceGroupName, String registryName, String componentName); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner createOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java new file mode 100644 index 0000000000000..3f3b31c21a09e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; + +/** An instance of this class provides access to all the operations defined in RegistryComponentVersionsClient. */ +public interface RegistryComponentVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String componentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner get(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java new file mode 100644 index 0000000000000..c787ec9c7013b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in RegistryDataContainersClient. */ +public interface RegistryDataContainersClient { + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner get(String resourceGroupName, String registryName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner createOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner createOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java new file mode 100644 index 0000000000000..f3dfe9b18c81b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** An instance of this class provides access to all the operations defined in RegistryDataVersionsClient. */ +public interface RegistryDataVersionsClient { + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String name); + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner get(String resourceGroupName, String registryName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner createOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner createOrUpdate( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String name, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java new file mode 100644 index 0000000000000..ed8169506312a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in RegistryEnvironmentContainersClient. */ +public interface RegistryEnvironmentContainersClient { + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner get(String resourceGroupName, String registryName, String environmentName); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner createOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java new file mode 100644 index 0000000000000..3aa53f0fea61d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in RegistryEnvironmentVersionsClient. */ +public interface RegistryEnvironmentVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String environmentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner get(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java new file mode 100644 index 0000000000000..72f4660742975 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** An instance of this class provides access to all the operations defined in RegistryModelContainersClient. */ +public interface RegistryModelContainersClient { + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner get(String resourceGroupName, String registryName, String modelName); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java new file mode 100644 index 0000000000000..5151ef1d95bad --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** An instance of this class provides access to all the operations defined in RegistryModelVersionsClient. */ +public interface RegistryModelVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String modelName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner get(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResponseInner packageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResponseInner packageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String modelName, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java index 442aaf6a54807..d0dbaacda75b8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java @@ -10,51 +10,72 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionUpdateParameter; /** An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. */ public interface WorkspaceConnectionsClient { /** - * The create operation. + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName); + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String target, String category, Context context); + + /** + * Delete machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, - Context context); + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context); /** - * The create operation. + * Delete machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceConnectionPropertiesV2BasicResourceInner create( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters); + void delete(String resourceGroupName, String workspaceName, String connectionName); /** - * The get operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -70,7 +91,7 @@ Response getWithResponse( String resourceGroupName, String workspaceName, String connectionName, Context context); /** - * The get operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -85,23 +106,28 @@ WorkspaceConnectionPropertiesV2BasicResourceInner get( String resourceGroupName, String workspaceName, String connectionName); /** - * The delete operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body Parameters for workspace connection update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionUpdateParameter body, + Context context); /** - * The delete operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -109,38 +135,76 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String connectionName); + WorkspaceConnectionPropertiesV2BasicResourceInner update( + String resourceGroupName, String workspaceName, String connectionName); /** - * The list operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param body The object for creating or updating a new workspace connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionPropertiesV2BasicResourceInner body, + Context context); /** - * The list operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceConnectionPropertiesV2BasicResourceInner create( + String resourceGroupName, String workspaceName, String connectionName); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceConnectionPropertiesV2BasicResourceInner listSecrets( + String resourceGroupName, String workspaceName, String connectionName); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java index 2057cda2ab5a4..22b68f52af6c5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java @@ -19,99 +19,95 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; /** An instance of this class provides access to all the operations defined in WorkspacesClient. */ public interface WorkspacesClient { /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace along with {@link Response}. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skip, String kind, Context context); /** - * Creates or updates a workspace with the specified parameters. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Creates or updates a workspace with the specified parameters. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String skip, String kind, Context context); /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName); /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner createOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context); /** * Deletes a machine learning workspace. @@ -121,56 +117,58 @@ WorkspaceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName); /** * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context); /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified machine learning workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, Context context); + WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); /** * Updates a machine learning workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -178,14 +176,14 @@ WorkspaceInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body); /** * Updates a machine learning workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -194,28 +192,28 @@ SyncPoller, WorkspaceInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context); /** * Updates a machine learning workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters); + WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body); /** * Updates a machine learning workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -224,35 +222,67 @@ SyncPoller, WorkspaceInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) WorkspaceInner update( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context); /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner body); /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context); + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner body); + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner body, Context context); /** * Diagnose workspace setup issue. @@ -273,7 +303,7 @@ SyncPoller, DiagnoseResponseResultInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -282,7 +312,7 @@ SyncPoller, DiagnoseResponseResultInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiagnoseResponseResultInner> beginDiagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context); /** * Diagnose workspace setup issue. @@ -302,7 +332,7 @@ SyncPoller, DiagnoseResponseResultInner> * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -311,7 +341,7 @@ SyncPoller, DiagnoseResponseResultInner> */ @ServiceMethod(returns = ReturnType.SINGLE) DiagnoseResponseResultInner diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and @@ -344,88 +374,91 @@ Response listKeysWithResponse( ListWorkspaceKeysResultInner listKeys(String resourceGroupName, String workspaceName); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return azure Machine Learning Workspace notebook access token along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listNotebookAccessTokenWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return azure Machine Learning Workspace notebook access token. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGroupName, String workspaceName); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void resyncKeys(String resourceGroupName, String workspaceName); + Response listNotebookKeysWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - void resyncKeys(String resourceGroupName, String workspaceName, Context context); + ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, String workspaceName); /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listStorageAccountKeysWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String skip, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceGroupName, String workspaceName); /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -436,11 +469,11 @@ Response listKeysWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listNotebookAccessTokenWithResponse( + Response listOutboundNetworkDependenciesEndpointsWithResponse( String resourceGroupName, String workspaceName, Context context); /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -450,10 +483,10 @@ Response listNotebookAccessTokenWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGroupName, String workspaceName); + ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String workspaceName); /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -467,7 +500,7 @@ SyncPoller, NotebookResourceInfoInner> beg String resourceGroupName, String workspaceName); /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -482,7 +515,7 @@ SyncPoller, NotebookResourceInfoInner> beg String resourceGroupName, String workspaceName, Context context); /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -495,7 +528,7 @@ SyncPoller, NotebookResourceInfoInner> beg NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName); /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -509,35 +542,22 @@ SyncPoller, NotebookResourceInfoInner> beg NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName, Context context); /** - * List storage account keys of a workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); - - /** - * List storage account keys of a workspace. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName); /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -545,27 +565,27 @@ Response listStorageAccountKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName, Context context); /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, String workspaceName); + void resyncKeys(String resourceGroupName, String workspaceName); /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -573,22 +593,7 @@ Response listNotebookKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context); - - /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String workspaceName); + void resyncKeys(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java index a21e00f4df18e..99900f13e38ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java @@ -5,23 +5,17 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; +import com.azure.resourcemanager.machinelearning.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** Azure Machine Learning workspace REST API operation. */ +/** Azure Machine Learning team account REST API operation. */ @Fluent public final class AmlOperationInner { /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of operation + * Gets or sets display name of operation */ @JsonProperty(value = "display") - private AmlOperationDisplay display; + private OperationDisplay display; /* * Indicates whether the operation applies to data-plane @@ -29,46 +23,38 @@ public final class AmlOperationInner { @JsonProperty(value = "isDataAction") private Boolean isDataAction; - /** Creates an instance of AmlOperationInner class. */ - public AmlOperationInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. + /* + * Gets or sets operation name: {provider}/{resource}/{operation} */ - public String name() { - return this.name; - } + @JsonProperty(value = "name") + private String name; - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the AmlOperationInner object itself. + /* + * The intended executor of the operation: user/system */ - public AmlOperationInner withName(String name) { - this.name = name; - return this; + @JsonProperty(value = "origin") + private String origin; + + /** Creates an instance of AmlOperationInner class. */ + public AmlOperationInner() { } /** - * Get the display property: Display name of operation. + * Get the display property: Gets or sets display name of operation. * * @return the display value. */ - public AmlOperationDisplay display() { + public OperationDisplay display() { return this.display; } /** - * Set the display property: Display name of operation. + * Set the display property: Gets or sets display name of operation. * * @param display the display value to set. * @return the AmlOperationInner object itself. */ - public AmlOperationInner withDisplay(AmlOperationDisplay display) { + public AmlOperationInner withDisplay(OperationDisplay display) { this.display = display; return this; } @@ -93,6 +79,46 @@ public AmlOperationInner withIsDataAction(Boolean isDataAction) { return this; } + /** + * Get the name property: Gets or sets operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the AmlOperationInner object itself. + */ + public AmlOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the origin property: The intended executor of the operation: user/system. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation: user/system. + * + * @param origin the origin value to set. + * @return the AmlOperationInner object itself. + */ + public AmlOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java index 2cb1bcd991478..c71d340ef7073 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java @@ -7,6 +7,8 @@ import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.machinelearning.models.AccountKeyDatastoreSecrets; import com.azure.resourcemanager.machinelearning.models.CertificateDatastoreSecrets; +import com.azure.resourcemanager.machinelearning.models.KerberosKeytabSecrets; +import com.azure.resourcemanager.machinelearning.models.KerberosPasswordSecrets; import com.azure.resourcemanager.machinelearning.models.SasDatastoreSecrets; import com.azure.resourcemanager.machinelearning.models.ServicePrincipalDatastoreSecrets; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -23,6 +25,8 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "AccountKey", value = AccountKeyDatastoreSecrets.class), @JsonSubTypes.Type(name = "Certificate", value = CertificateDatastoreSecrets.class), + @JsonSubTypes.Type(name = "KerberosKeytab", value = KerberosKeytabSecrets.class), + @JsonSubTypes.Type(name = "KerberosPassword", value = KerberosPasswordSecrets.class), @JsonSubTypes.Type(name = "Sas", value = SasDatastoreSecrets.class), @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalDatastoreSecrets.class) }) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExportSummaryInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExportSummaryInner.java new file mode 100644 index 0000000000000..ac7a9f1a822b7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExportSummaryInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.machinelearning.models.CocoExportSummary; +import com.azure.resourcemanager.machinelearning.models.CsvExportSummary; +import com.azure.resourcemanager.machinelearning.models.DatasetExportSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The ExportSummary model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "format", + defaultImpl = ExportSummaryInner.class) +@JsonTypeName("ExportSummary") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Coco", value = CocoExportSummary.class), + @JsonSubTypes.Type(name = "CSV", value = CsvExportSummary.class), + @JsonSubTypes.Type(name = "Dataset", value = DatasetExportSummary.class) +}) +@Immutable +public class ExportSummaryInner { + /* + * The time when the export was completed. + */ + @JsonProperty(value = "endDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endDateTime; + + /* + * The total number of labeled datapoints exported. + */ + @JsonProperty(value = "exportedRowCount", access = JsonProperty.Access.WRITE_ONLY) + private Long exportedRowCount; + + /* + * Name and identifier of the job containing exported labels. + */ + @JsonProperty(value = "labelingJobId", access = JsonProperty.Access.WRITE_ONLY) + private String labelingJobId; + + /* + * The time when the export was requested. + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /** Creates an instance of ExportSummaryInner class. */ + public ExportSummaryInner() { + } + + /** + * Get the endDateTime property: The time when the export was completed. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Get the exportedRowCount property: The total number of labeled datapoints exported. + * + * @return the exportedRowCount value. + */ + public Long exportedRowCount() { + return this.exportedRowCount; + } + + /** + * Get the labelingJobId property: Name and identifier of the job containing exported labels. + * + * @return the labelingJobId value. + */ + public String labelingJobId() { + return this.labelingJobId; + } + + /** + * Get the startDateTime property: The time when the export was requested. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java index 8dbef74cad4f9..80c2a07bccdbf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; +import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsPropertyBag; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,7 +16,7 @@ public final class ExternalFqdnResponseInner { * The value property. */ @JsonProperty(value = "value") - private List value; + private List value; /** Creates an instance of ExternalFqdnResponseInner class. */ public ExternalFqdnResponseInner() { @@ -27,7 +27,7 @@ public ExternalFqdnResponseInner() { * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -37,7 +37,7 @@ public List value() { * @param value the value value to set. * @return the ExternalFqdnResponseInner object itself. */ - public ExternalFqdnResponseInner withValue(List value) { + public ExternalFqdnResponseInner withValue(List value) { this.value = value; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java new file mode 100644 index 0000000000000..e4d4b0bf9ad06 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.FeatureProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class FeatureInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private FeatureProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of FeatureInner class. */ + public FeatureInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeatureProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeatureInner object itself. + */ + public FeatureInner withProperties(FeatureProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model FeatureInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java new file mode 100644 index 0000000000000..c5b1b9bce0c73 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class FeaturesetContainerInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private FeaturesetContainerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of FeaturesetContainerInner class. */ + public FeaturesetContainerInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturesetContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturesetContainerInner object itself. + */ + public FeaturesetContainerInner withProperties(FeaturesetContainerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model FeaturesetContainerInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetContainerInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetJobInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetJobInner.java new file mode 100644 index 0000000000000..90901f6dfdbf4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetJobInner.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreJobType; +import com.azure.resourcemanager.machinelearning.models.JobStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Dto object representing the feature set job. */ +@Fluent +public final class FeaturesetJobInner { + /* + * Specifies the created date + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * Specifies the display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Specifies the duration + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * Specifies the experiment id + */ + @JsonProperty(value = "experimentId") + private String experimentId; + + /* + * Specifies the backfill feature window to be materialized + */ + @JsonProperty(value = "featureWindow") + private FeatureWindow featureWindow; + + /* + * Specifies the job id + */ + @JsonProperty(value = "jobId") + private String jobId; + + /* + * Specifies the job status + */ + @JsonProperty(value = "status") + private JobStatus status; + + /* + * Specifies the tags if any + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Specifies the feature store job type + */ + @JsonProperty(value = "type") + private FeaturestoreJobType type; + + /** Creates an instance of FeaturesetJobInner class. */ + public FeaturesetJobInner() { + } + + /** + * Get the createdDate property: Specifies the created date. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: Specifies the created date. + * + * @param createdDate the createdDate value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the displayName property: Specifies the display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Specifies the display name. + * + * @param displayName the displayName value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the duration property: Specifies the duration. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Specifies the duration. + * + * @param duration the duration value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the experimentId property: Specifies the experiment id. + * + * @return the experimentId value. + */ + public String experimentId() { + return this.experimentId; + } + + /** + * Set the experimentId property: Specifies the experiment id. + * + * @param experimentId the experimentId value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withExperimentId(String experimentId) { + this.experimentId = experimentId; + return this; + } + + /** + * Get the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @return the featureWindow value. + */ + public FeatureWindow featureWindow() { + return this.featureWindow; + } + + /** + * Set the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @param featureWindow the featureWindow value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withFeatureWindow(FeatureWindow featureWindow) { + this.featureWindow = featureWindow; + return this; + } + + /** + * Get the jobId property: Specifies the job id. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: Specifies the job id. + * + * @param jobId the jobId value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the status property: Specifies the job status. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies the job status. + * + * @param status the status value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get the tags property: Specifies the tags if any. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Specifies the tags if any. + * + * @param tags the tags value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the type property: Specifies the feature store job type. + * + * @return the type value. + */ + public FeaturestoreJobType type() { + return this.type; + } + + /** + * Set the type property: Specifies the feature store job type. + * + * @param type the type value to set. + * @return the FeaturesetJobInner object itself. + */ + public FeaturesetJobInner withType(FeaturestoreJobType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featureWindow() != null) { + featureWindow().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java new file mode 100644 index 0000000000000..53d1791f92133 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class FeaturesetVersionInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private FeaturesetVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of FeaturesetVersionInner class. */ + public FeaturesetVersionInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturesetVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturesetVersionInner object itself. + */ + public FeaturesetVersionInner withProperties(FeaturesetVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model FeaturesetVersionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetVersionInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java new file mode 100644 index 0000000000000..56f7e4881e7db --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class FeaturestoreEntityContainerInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private FeaturestoreEntityContainerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of FeaturestoreEntityContainerInner class. */ + public FeaturestoreEntityContainerInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturestoreEntityContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturestoreEntityContainerInner object itself. + */ + public FeaturestoreEntityContainerInner withProperties(FeaturestoreEntityContainerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model FeaturestoreEntityContainerInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityContainerInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java new file mode 100644 index 0000000000000..58277a053be0f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class FeaturestoreEntityVersionInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private FeaturestoreEntityVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of FeaturestoreEntityVersionInner class. */ + public FeaturestoreEntityVersionInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturestoreEntityVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturestoreEntityVersionInner object itself. + */ + public FeaturestoreEntityVersionInner withProperties(FeaturestoreEntityVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model FeaturestoreEntityVersionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityVersionInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/LabelingJobInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/LabelingJobInner.java new file mode 100644 index 0000000000000..3c5a018d5073b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/LabelingJobInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.LabelingJobProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope. */ +@Fluent +public final class LabelingJobInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private LabelingJobProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of LabelingJobInner class. */ + public LabelingJobInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public LabelingJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the LabelingJobInner object itself. + */ + public LabelingJobInner withProperties(LabelingJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model LabelingJobInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LabelingJobInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java index 7750f1375b4c3..9677b0471fe7d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java @@ -11,13 +11,13 @@ @Immutable public final class ListNotebookKeysResultInner { /* - * The primaryAccessKey property. + * The primary access key of the Notebook */ @JsonProperty(value = "primaryAccessKey", access = JsonProperty.Access.WRITE_ONLY) private String primaryAccessKey; /* - * The secondaryAccessKey property. + * The secondary access key of the Notebook */ @JsonProperty(value = "secondaryAccessKey", access = JsonProperty.Access.WRITE_ONLY) private String secondaryAccessKey; @@ -27,7 +27,7 @@ public ListNotebookKeysResultInner() { } /** - * Get the primaryAccessKey property: The primaryAccessKey property. + * Get the primaryAccessKey property: The primary access key of the Notebook. * * @return the primaryAccessKey value. */ @@ -36,7 +36,7 @@ public String primaryAccessKey() { } /** - * Get the secondaryAccessKey property: The secondaryAccessKey property. + * Get the secondaryAccessKey property: The secondary access key of the Notebook. * * @return the secondaryAccessKey value. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java index f4fd116ddf389..98a9f875e9c20 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java @@ -11,7 +11,7 @@ @Immutable public final class ListStorageAccountKeysResultInner { /* - * The userStorageKey property. + * The access key of the storage */ @JsonProperty(value = "userStorageKey", access = JsonProperty.Access.WRITE_ONLY) private String userStorageKey; @@ -21,7 +21,7 @@ public ListStorageAccountKeysResultInner() { } /** - * Get the userStorageKey property: The userStorageKey property. + * Get the userStorageKey property: The access key of the storage. * * @return the userStorageKey value. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java index 7e18cd1ee62ea..1690eb1805e53 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java @@ -4,27 +4,15 @@ package com.azure.resourcemanager.machinelearning.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.machinelearning.models.RegistryListCredentialsResult; import com.fasterxml.jackson.annotation.JsonProperty; /** The ListWorkspaceKeysResult model. */ -@Immutable +@Fluent public final class ListWorkspaceKeysResultInner { /* - * The userStorageKey property. - */ - @JsonProperty(value = "userStorageKey", access = JsonProperty.Access.WRITE_ONLY) - private String userStorageKey; - - /* - * The userStorageResourceId property. - */ - @JsonProperty(value = "userStorageResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String userStorageResourceId; - - /* - * The appInsightsInstrumentationKey property. + * The access key of the workspace app insights */ @JsonProperty(value = "appInsightsInstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) private String appInsightsInstrumentationKey; @@ -32,39 +20,33 @@ public final class ListWorkspaceKeysResultInner { /* * The containerRegistryCredentials property. */ - @JsonProperty(value = "containerRegistryCredentials", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "containerRegistryCredentials") private RegistryListCredentialsResult containerRegistryCredentials; /* * The notebookAccessKeys property. */ - @JsonProperty(value = "notebookAccessKeys", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "notebookAccessKeys") private ListNotebookKeysResultInner notebookAccessKeys; - /** Creates an instance of ListWorkspaceKeysResultInner class. */ - public ListWorkspaceKeysResultInner() { - } - - /** - * Get the userStorageKey property: The userStorageKey property. - * - * @return the userStorageKey value. + /* + * The arm Id key of the workspace storage */ - public String userStorageKey() { - return this.userStorageKey; - } + @JsonProperty(value = "userStorageArmId", access = JsonProperty.Access.WRITE_ONLY) + private String userStorageArmId; - /** - * Get the userStorageResourceId property: The userStorageResourceId property. - * - * @return the userStorageResourceId value. + /* + * The access key of the workspace storage */ - public String userStorageResourceId() { - return this.userStorageResourceId; + @JsonProperty(value = "userStorageKey", access = JsonProperty.Access.WRITE_ONLY) + private String userStorageKey; + + /** Creates an instance of ListWorkspaceKeysResultInner class. */ + public ListWorkspaceKeysResultInner() { } /** - * Get the appInsightsInstrumentationKey property: The appInsightsInstrumentationKey property. + * Get the appInsightsInstrumentationKey property: The access key of the workspace app insights. * * @return the appInsightsInstrumentationKey value. */ @@ -81,6 +63,18 @@ public RegistryListCredentialsResult containerRegistryCredentials() { return this.containerRegistryCredentials; } + /** + * Set the containerRegistryCredentials property: The containerRegistryCredentials property. + * + * @param containerRegistryCredentials the containerRegistryCredentials value to set. + * @return the ListWorkspaceKeysResultInner object itself. + */ + public ListWorkspaceKeysResultInner withContainerRegistryCredentials( + RegistryListCredentialsResult containerRegistryCredentials) { + this.containerRegistryCredentials = containerRegistryCredentials; + return this; + } + /** * Get the notebookAccessKeys property: The notebookAccessKeys property. * @@ -90,6 +84,35 @@ public ListNotebookKeysResultInner notebookAccessKeys() { return this.notebookAccessKeys; } + /** + * Set the notebookAccessKeys property: The notebookAccessKeys property. + * + * @param notebookAccessKeys the notebookAccessKeys value to set. + * @return the ListWorkspaceKeysResultInner object itself. + */ + public ListWorkspaceKeysResultInner withNotebookAccessKeys(ListNotebookKeysResultInner notebookAccessKeys) { + this.notebookAccessKeys = notebookAccessKeys; + return this; + } + + /** + * Get the userStorageArmId property: The arm Id key of the workspace storage. + * + * @return the userStorageArmId value. + */ + public String userStorageArmId() { + return this.userStorageArmId; + } + + /** + * Get the userStorageKey property: The access key of the workspace storage. + * + * @return the userStorageKey value. + */ + public String userStorageKey() { + return this.userStorageKey; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java new file mode 100644 index 0000000000000..e2cc21faca0c7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Status of the Provisioning for the managed network of a machine learning workspace. */ +@Fluent +public final class ManagedNetworkProvisionStatusInner { + /* + * The sparkReady property. + */ + @JsonProperty(value = "sparkReady") + private Boolean sparkReady; + + /* + * Status for the managed network of a machine learning workspace. + */ + @JsonProperty(value = "status") + private ManagedNetworkStatus status; + + /** Creates an instance of ManagedNetworkProvisionStatusInner class. */ + public ManagedNetworkProvisionStatusInner() { + } + + /** + * Get the sparkReady property: The sparkReady property. + * + * @return the sparkReady value. + */ + public Boolean sparkReady() { + return this.sparkReady; + } + + /** + * Set the sparkReady property: The sparkReady property. + * + * @param sparkReady the sparkReady value to set. + * @return the ManagedNetworkProvisionStatusInner object itself. + */ + public ManagedNetworkProvisionStatusInner withSparkReady(Boolean sparkReady) { + this.sparkReady = sparkReady; + return this; + } + + /** + * Get the status property: Status for the managed network of a machine learning workspace. + * + * @return the status value. + */ + public ManagedNetworkStatus status() { + return this.status; + } + + /** + * Set the status property: Status for the managed network of a machine learning workspace. + * + * @param status the status value to set. + * @return the ManagedNetworkProvisionStatusInner object itself. + */ + public ManagedNetworkProvisionStatusInner withStatus(ManagedNetworkStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java new file mode 100644 index 0000000000000..9ccd596426156 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.IsolationMode; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed Network settings for a machine learning workspace. */ +@Fluent +public final class ManagedNetworkSettingsInner { + /* + * Isolation mode for the managed network of a machine learning workspace. + */ + @JsonProperty(value = "isolationMode") + private IsolationMode isolationMode; + + /* + * The networkId property. + */ + @JsonProperty(value = "networkId", access = JsonProperty.Access.WRITE_ONLY) + private String networkId; + + /* + * Dictionary of + */ + @JsonProperty(value = "outboundRules") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map outboundRules; + + /* + * Status of the Provisioning for the managed network of a machine learning workspace. + */ + @JsonProperty(value = "status") + private ManagedNetworkProvisionStatusInner status; + + /** Creates an instance of ManagedNetworkSettingsInner class. */ + public ManagedNetworkSettingsInner() { + } + + /** + * Get the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @return the isolationMode value. + */ + public IsolationMode isolationMode() { + return this.isolationMode; + } + + /** + * Set the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @param isolationMode the isolationMode value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withIsolationMode(IsolationMode isolationMode) { + this.isolationMode = isolationMode; + return this; + } + + /** + * Get the networkId property: The networkId property. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Get the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + public Map outboundRules() { + return this.outboundRules; + } + + /** + * Set the outboundRules property: Dictionary of <OutboundRule>. + * + * @param outboundRules the outboundRules value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withOutboundRules(Map outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @return the status value. + */ + public ManagedNetworkProvisionStatusInner status() { + return this.status; + } + + /** + * Set the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @param status the status value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withStatus(ManagedNetworkProvisionStatusInner status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outboundRules() != null) { + outboundRules() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java index 6fb3125ba2403..34837fc3882d1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java @@ -11,40 +11,34 @@ @Immutable public final class NotebookAccessTokenResultInner { /* - * The notebookResourceId property. - */ - @JsonProperty(value = "notebookResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String notebookResourceId; - - /* - * The hostName property. + * The accessToken property. */ - @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; + @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) + private String accessToken; /* - * The publicDns property. + * The expiresIn property. */ - @JsonProperty(value = "publicDns", access = JsonProperty.Access.WRITE_ONLY) - private String publicDns; + @JsonProperty(value = "expiresIn", access = JsonProperty.Access.WRITE_ONLY) + private Integer expiresIn; /* - * The accessToken property. + * The hostName property. */ - @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) - private String accessToken; + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; /* - * The tokenType property. + * The notebookResourceId property. */ - @JsonProperty(value = "tokenType", access = JsonProperty.Access.WRITE_ONLY) - private String tokenType; + @JsonProperty(value = "notebookResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String notebookResourceId; /* - * The expiresIn property. + * The publicDns property. */ - @JsonProperty(value = "expiresIn", access = JsonProperty.Access.WRITE_ONLY) - private Integer expiresIn; + @JsonProperty(value = "publicDns", access = JsonProperty.Access.WRITE_ONLY) + private String publicDns; /* * The refreshToken property. @@ -58,62 +52,59 @@ public final class NotebookAccessTokenResultInner { @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) private String scope; + /* + * The tokenType property. + */ + @JsonProperty(value = "tokenType", access = JsonProperty.Access.WRITE_ONLY) + private String tokenType; + /** Creates an instance of NotebookAccessTokenResultInner class. */ public NotebookAccessTokenResultInner() { } /** - * Get the notebookResourceId property: The notebookResourceId property. - * - * @return the notebookResourceId value. - */ - public String notebookResourceId() { - return this.notebookResourceId; - } - - /** - * Get the hostname property: The hostName property. + * Get the accessToken property: The accessToken property. * - * @return the hostname value. + * @return the accessToken value. */ - public String hostname() { - return this.hostname; + public String accessToken() { + return this.accessToken; } /** - * Get the publicDns property: The publicDns property. + * Get the expiresIn property: The expiresIn property. * - * @return the publicDns value. + * @return the expiresIn value. */ - public String publicDns() { - return this.publicDns; + public Integer expiresIn() { + return this.expiresIn; } /** - * Get the accessToken property: The accessToken property. + * Get the hostname property: The hostName property. * - * @return the accessToken value. + * @return the hostname value. */ - public String accessToken() { - return this.accessToken; + public String hostname() { + return this.hostname; } /** - * Get the tokenType property: The tokenType property. + * Get the notebookResourceId property: The notebookResourceId property. * - * @return the tokenType value. + * @return the notebookResourceId value. */ - public String tokenType() { - return this.tokenType; + public String notebookResourceId() { + return this.notebookResourceId; } /** - * Get the expiresIn property: The expiresIn property. + * Get the publicDns property: The publicDns property. * - * @return the expiresIn value. + * @return the publicDns value. */ - public Integer expiresIn() { - return this.expiresIn; + public String publicDns() { + return this.publicDns; } /** @@ -134,6 +125,15 @@ public String scope() { return this.scope; } + /** + * Get the tokenType property: The tokenType property. + * + * @return the tokenType value. + */ + public String tokenType() { + return this.tokenType; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java index 9433886680171..b8fe99eba68fe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java @@ -18,10 +18,10 @@ public final class NotebookResourceInfoInner { private String fqdn; /* - * the data plane resourceId that used to initialize notebook component + * The isPrivateLinkEnabled property. */ - @JsonProperty(value = "resourceId") - private String resourceId; + @JsonProperty(value = "isPrivateLinkEnabled") + private Boolean isPrivateLinkEnabled; /* * The error that occurs when preparing notebook. @@ -29,6 +29,12 @@ public final class NotebookResourceInfoInner { @JsonProperty(value = "notebookPreparationError") private NotebookPreparationError notebookPreparationError; + /* + * the data plane resourceId that used to initialize notebook component + */ + @JsonProperty(value = "resourceId") + private String resourceId; + /** Creates an instance of NotebookResourceInfoInner class. */ public NotebookResourceInfoInner() { } @@ -54,22 +60,22 @@ public NotebookResourceInfoInner withFqdn(String fqdn) { } /** - * Get the resourceId property: the data plane resourceId that used to initialize notebook component. + * Get the isPrivateLinkEnabled property: The isPrivateLinkEnabled property. * - * @return the resourceId value. + * @return the isPrivateLinkEnabled value. */ - public String resourceId() { - return this.resourceId; + public Boolean isPrivateLinkEnabled() { + return this.isPrivateLinkEnabled; } /** - * Set the resourceId property: the data plane resourceId that used to initialize notebook component. + * Set the isPrivateLinkEnabled property: The isPrivateLinkEnabled property. * - * @param resourceId the resourceId value to set. + * @param isPrivateLinkEnabled the isPrivateLinkEnabled value to set. * @return the NotebookResourceInfoInner object itself. */ - public NotebookResourceInfoInner withResourceId(String resourceId) { - this.resourceId = resourceId; + public NotebookResourceInfoInner withIsPrivateLinkEnabled(Boolean isPrivateLinkEnabled) { + this.isPrivateLinkEnabled = isPrivateLinkEnabled; return this; } @@ -93,6 +99,26 @@ public NotebookResourceInfoInner withNotebookPreparationError(NotebookPreparatio return this; } + /** + * Get the resourceId property: the data plane resourceId that used to initialize notebook component. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: the data plane resourceId that used to initialize notebook component. + * + * @param resourceId the resourceId value to set. + * @return the NotebookResourceInfoInner object itself. + */ + public NotebookResourceInfoInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java new file mode 100644 index 0000000000000..3e779e74b239c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Outbound Rule Basic Resource for the managed network of a machine learning workspace. */ +@Fluent +public final class OutboundRuleBasicResourceInner extends ProxyResource { + /* + * Outbound Rule for the managed network of a machine learning workspace. + */ + @JsonProperty(value = "properties", required = true) + private OutboundRule properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of OutboundRuleBasicResourceInner class. */ + public OutboundRuleBasicResourceInner() { + } + + /** + * Get the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @return the properties value. + */ + public OutboundRule properties() { + return this.properties; + } + + /** + * Set the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @param properties the properties value to set. + * @return the OutboundRuleBasicResourceInner object itself. + */ + public OutboundRuleBasicResourceInner withProperties(OutboundRule properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model OutboundRuleBasicResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OutboundRuleBasicResourceInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PackageResponseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PackageResponseInner.java new file mode 100644 index 0000000000000..415039dfc46ec --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PackageResponseInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentSource; +import com.azure.resourcemanager.machinelearning.models.InferencingServer; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageBuildState; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Package response returned after async package operation completes successfully. */ +@Immutable +public final class PackageResponseInner { + /* + * Base environment to start with. + */ + @JsonProperty(value = "baseEnvironmentSource", access = JsonProperty.Access.WRITE_ONLY) + private BaseEnvironmentSource baseEnvironmentSource; + + /* + * Build id of the image build operation. + */ + @JsonProperty(value = "buildId", access = JsonProperty.Access.WRITE_ONLY) + private String buildId; + + /* + * Build state of the image build operation. + */ + @JsonProperty(value = "buildState", access = JsonProperty.Access.WRITE_ONLY) + private PackageBuildState buildState; + + /* + * Collection of environment variables. + */ + @JsonProperty(value = "environmentVariables", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map environmentVariables; + + /* + * Inferencing server configurations. + */ + @JsonProperty(value = "inferencingServer", access = JsonProperty.Access.WRITE_ONLY) + private InferencingServer inferencingServer; + + /* + * Collection of inputs. + */ + @JsonProperty(value = "inputs", access = JsonProperty.Access.WRITE_ONLY) + private List inputs; + + /* + * Log url of the image build operation. + */ + @JsonProperty(value = "logUrl", access = JsonProperty.Access.WRITE_ONLY) + private String logUrl; + + /* + * Model configuration including the mount mode. + */ + @JsonProperty(value = "modelConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private ModelConfiguration modelConfiguration; + + /* + * Tag dictionary. Tags can be added, removed, and updated. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Asset ID of the target environment created by package operation. + */ + @JsonProperty(value = "targetEnvironmentId", access = JsonProperty.Access.WRITE_ONLY) + private String targetEnvironmentId; + + /** Creates an instance of PackageResponseInner class. */ + public PackageResponseInner() { + } + + /** + * Get the baseEnvironmentSource property: Base environment to start with. + * + * @return the baseEnvironmentSource value. + */ + public BaseEnvironmentSource baseEnvironmentSource() { + return this.baseEnvironmentSource; + } + + /** + * Get the buildId property: Build id of the image build operation. + * + * @return the buildId value. + */ + public String buildId() { + return this.buildId; + } + + /** + * Get the buildState property: Build state of the image build operation. + * + * @return the buildState value. + */ + public PackageBuildState buildState() { + return this.buildState; + } + + /** + * Get the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Get the inferencingServer property: Inferencing server configurations. + * + * @return the inferencingServer value. + */ + public InferencingServer inferencingServer() { + return this.inferencingServer; + } + + /** + * Get the inputs property: Collection of inputs. + * + * @return the inputs value. + */ + public List inputs() { + return this.inputs; + } + + /** + * Get the logUrl property: Log url of the image build operation. + * + * @return the logUrl value. + */ + public String logUrl() { + return this.logUrl; + } + + /** + * Get the modelConfiguration property: Model configuration including the mount mode. + * + * @return the modelConfiguration value. + */ + public ModelConfiguration modelConfiguration() { + return this.modelConfiguration; + } + + /** + * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the targetEnvironmentId property: Asset ID of the target environment created by package operation. + * + * @return the targetEnvironmentId value. + */ + public String targetEnvironmentId() { + return this.targetEnvironmentId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseEnvironmentSource() != null) { + baseEnvironmentSource().validate(); + } + if (inferencingServer() != null) { + inferencingServer().validate(); + } + if (inputs() != null) { + inputs().forEach(e -> e.validate()); + } + if (modelConfiguration() != null) { + modelConfiguration().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java new file mode 100644 index 0000000000000..55a0e08858ba2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.BlobReferenceForConsumptionDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PendingUploadResponseDto model. */ +@Fluent +public final class PendingUploadResponseDtoInner { + /* + * Container level read, write, list SAS + */ + @JsonProperty(value = "blobReferenceForConsumption") + private BlobReferenceForConsumptionDto blobReferenceForConsumption; + + /* + * ID for this upload request + */ + @JsonProperty(value = "pendingUploadId") + private String pendingUploadId; + + /* + * TemporaryBlobReference is the only supported type + */ + @JsonProperty(value = "pendingUploadType") + private PendingUploadType pendingUploadType; + + /** Creates an instance of PendingUploadResponseDtoInner class. */ + public PendingUploadResponseDtoInner() { + } + + /** + * Get the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @return the blobReferenceForConsumption value. + */ + public BlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.blobReferenceForConsumption; + } + + /** + * Set the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @param blobReferenceForConsumption the blobReferenceForConsumption value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner withBlobReferenceForConsumption( + BlobReferenceForConsumptionDto blobReferenceForConsumption) { + this.blobReferenceForConsumption = blobReferenceForConsumption; + return this; + } + + /** + * Get the pendingUploadId property: ID for this upload request. + * + * @return the pendingUploadId value. + */ + public String pendingUploadId() { + return this.pendingUploadId; + } + + /** + * Set the pendingUploadId property: ID for this upload request. + * + * @param pendingUploadId the pendingUploadId value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner withPendingUploadId(String pendingUploadId) { + this.pendingUploadId = pendingUploadId; + return this; + } + + /** + * Get the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + public PendingUploadType pendingUploadType() { + return this.pendingUploadType; + } + + /** + * Set the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @param pendingUploadType the pendingUploadType value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner withPendingUploadType(PendingUploadType pendingUploadType) { + this.pendingUploadType = pendingUploadType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobReferenceForConsumption() != null) { + blobReferenceForConsumption().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java index ac7de011781ba..6c813baf0fac4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java @@ -8,10 +8,10 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspacePrivateEndpointResource; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -20,36 +20,36 @@ @Fluent public final class PrivateEndpointConnectionInner extends ProxyResource { /* - * Resource properties. - */ - @JsonProperty(value = "properties") - private PrivateEndpointConnectionProperties innerProperties; - - /* - * The identity of the resource. + * Managed service identity (system assigned and/or user assigned identities) */ @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* - * Specifies the location of the resource. + * Same as workspace location. */ @JsonProperty(value = "location") private String location; /* - * Contains resource tags defined as key/value pairs. + * Private endpoint connection properties. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; /* - * The sku of the workspace. + * Optional. This field is required to be implemented by the RP because AML is supporting more than one tier */ @JsonProperty(value = "sku") private Sku sku; + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -61,16 +61,7 @@ public PrivateEndpointConnectionInner() { } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the resource. + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ @@ -79,7 +70,7 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: The identity of the resource. + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). * * @param identity the identity value to set. * @return the PrivateEndpointConnectionInner object itself. @@ -90,7 +81,7 @@ public PrivateEndpointConnectionInner withIdentity(ManagedServiceIdentity identi } /** - * Get the location property: Specifies the location of the resource. + * Get the location property: Same as workspace location. * * @return the location value. */ @@ -99,7 +90,7 @@ public String location() { } /** - * Set the location property: Specifies the location of the resource. + * Set the location property: Same as workspace location. * * @param location the location value to set. * @return the PrivateEndpointConnectionInner object itself. @@ -110,42 +101,53 @@ public PrivateEndpointConnectionInner withLocation(String location) { } /** - * Get the tags property: Contains resource tags defined as key/value pairs. + * Get the innerProperties property: Private endpoint connection properties. * - * @return the tags value. + * @return the innerProperties value. */ - public Map tags() { - return this.tags; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; } /** - * Set the tags property: Contains resource tags defined as key/value pairs. + * Get the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * - * @param tags the tags value to set. + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. + * + * @param sku the sku value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withTags(Map tags) { - this.tags = tags; + public PrivateEndpointConnectionInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the sku property: The sku of the workspace. + * Get the tags property: Dictionary of <string>. * - * @return the sku value. + * @return the tags value. */ - public Sku sku() { - return this.sku; + public Map tags() { + return this.tags; } /** - * Set the sku property: The sku of the workspace. + * Set the tags property: Dictionary of <string>. * - * @param sku the sku value to set. + * @param tags the tags value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withSku(Sku sku) { - this.sku = sku; + public PrivateEndpointConnectionInner withTags(Map tags) { + this.tags = tags; return this; } @@ -159,21 +161,21 @@ public SystemData systemData() { } /** - * Get the privateEndpoint property: The resource of private end point. + * Get the privateEndpoint property: The Private Endpoint resource. * * @return the privateEndpoint value. */ - public PrivateEndpoint privateEndpoint() { + public WorkspacePrivateEndpointResource privateEndpoint() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); } /** - * Set the privateEndpoint property: The resource of private end point. + * Set the privateEndpoint property: The Private Endpoint resource. * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + public PrivateEndpointConnectionInner withPrivateEndpoint(WorkspacePrivateEndpointResource privateEndpoint) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -182,8 +184,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat } /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. + * Get the privateLinkServiceConnectionState property: The connection state. * * @return the privateLinkServiceConnectionState value. */ @@ -192,8 +193,7 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { } /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. + * Set the privateLinkServiceConnectionState property: The connection state. * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionInner object itself. @@ -208,7 +208,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( } /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * Get the provisioningState property: The current provisioning state. * * @return the provisioningState value. */ @@ -222,12 +222,12 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } if (identity() != null) { identity().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } if (sku() != null) { sku().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java index c09c5305622f9..cadf024d3f8e4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java @@ -5,29 +5,28 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.WorkspacePrivateEndpointResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties of the PrivateEndpointConnectProperties. */ +/** Private endpoint connection properties. */ @Fluent public final class PrivateEndpointConnectionProperties { /* - * The resource of private end point. + * The Private Endpoint resource. */ @JsonProperty(value = "privateEndpoint") - private PrivateEndpoint privateEndpoint; + private WorkspacePrivateEndpointResource privateEndpoint; /* - * A collection of information about the state of the connection between service consumer and provider. + * The connection state. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + @JsonProperty(value = "privateLinkServiceConnectionState") private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* - * The provisioning state of the private endpoint connection resource. + * The current provisioning state. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; @@ -37,28 +36,27 @@ public PrivateEndpointConnectionProperties() { } /** - * Get the privateEndpoint property: The resource of private end point. + * Get the privateEndpoint property: The Private Endpoint resource. * * @return the privateEndpoint value. */ - public PrivateEndpoint privateEndpoint() { + public WorkspacePrivateEndpointResource privateEndpoint() { return this.privateEndpoint; } /** - * Set the privateEndpoint property: The resource of private end point. + * Set the privateEndpoint property: The Private Endpoint resource. * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + public PrivateEndpointConnectionProperties withPrivateEndpoint(WorkspacePrivateEndpointResource privateEndpoint) { this.privateEndpoint = privateEndpoint; return this; } /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. + * Get the privateLinkServiceConnectionState property: The connection state. * * @return the privateLinkServiceConnectionState value. */ @@ -67,8 +65,7 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { } /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. + * Set the privateLinkServiceConnectionState property: The connection state. * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. @@ -80,7 +77,7 @@ public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState } /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * Get the provisioningState property: The current provisioning state. * * @return the provisioningState value. */ @@ -97,16 +94,8 @@ public void validate() { if (privateEndpoint() != null) { privateEndpoint().validate(); } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); - } else { + if (privateLinkServiceConnectionState() != null) { privateLinkServiceConnectionState().validate(); } } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..856d1ae1ba7e6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Same as workspace location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Properties of a private link resource. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Optional. This field is required to be implemented by the RP because AML is supporting more than one tier + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: Same as workspace location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Same as workspace location. + * + * @param location the location value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Properties of a private link resource. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. + * + * @param sku the sku value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredMembers(requiredMembers); + return this; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java deleted file mode 100644 index 6047466b92300..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Fluent -public final class PrivateLinkResourceListResultInner { - /* - * Array of private link resources - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of PrivateLinkResourceListResultInner class. */ - public PrivateLinkResourceListResultInner() { - } - - /** - * Get the value property: Array of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResultInner object itself. - */ - public PrivateLinkResourceListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java index 7547a19c2fa61..3d319157c868f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java @@ -14,13 +14,13 @@ public final class PrivateLinkResourceProperties { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "groupId") private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "requiredMembers") private List requiredMembers; /* @@ -42,6 +42,17 @@ public String groupId() { return this.groupId; } + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + /** * Get the requiredMembers property: The private link resource required member names. * @@ -51,6 +62,17 @@ public List requiredMembers() { return this.requiredMembers; } + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + /** * Get the requiredZoneNames property: The private link resource Private link DNS zone name. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java new file mode 100644 index 0000000000000..0f0c65ac906d1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The Registry model. */ +@Fluent +public final class RegistryInner extends Resource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * [Required] Additional attributes of the entity. + */ + @JsonProperty(value = "properties", required = true) + private RegistryProperties innerProperties = new RegistryProperties(); + + /* + * Sku details required for ARM contract for Autoscaling. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RegistryInner class. */ + public RegistryInner() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @param kind the kind value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the innerProperties property: [Required] Additional attributes of the entity. + * + * @return the innerProperties value. + */ + private RegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + public String discoveryUrl() { + return this.innerProperties() == null ? null : this.innerProperties().discoveryUrl(); + } + + /** + * Set the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl the discoveryUrl value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withDiscoveryUrl(String discoveryUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withDiscoveryUrl(discoveryUrl); + return this; + } + + /** + * Get the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + public String intellectualPropertyPublisher() { + return this.innerProperties() == null ? null : this.innerProperties().intellectualPropertyPublisher(); + } + + /** + * Set the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher the intellectualPropertyPublisher value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withIntellectualPropertyPublisher(intellectualPropertyPublisher); + return this; + } + + /** + * Get the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @return the managedResourceGroup value. + */ + public ArmResourceId managedResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroup(); + } + + /** + * Set the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @param managedResourceGroup the managedResourceGroup value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withManagedResourceGroup(ArmResourceId managedResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withManagedResourceGroup(managedResourceGroup); + return this; + } + + /** + * Get the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + public String mlFlowRegistryUri() { + return this.innerProperties() == null ? null : this.innerProperties().mlFlowRegistryUri(); + } + + /** + * Set the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri the mlFlowRegistryUri value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withMlFlowRegistryUri(String mlFlowRegistryUri) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withMlFlowRegistryUri(mlFlowRegistryUri); + return this; + } + + /** + * Get the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + public List registryPrivateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().registryPrivateEndpointConnections(); + } + + /** + * Set the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @param registryPrivateEndpointConnections the registryPrivateEndpointConnections value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withRegistryPrivateEndpointConnections(registryPrivateEndpointConnections); + return this; + } + + /** + * Get the publicNetworkAccess property: Is the Registry accessible from the internet? Possible values: "Enabled" or + * "Disabled". + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Is the Registry accessible from the internet? Possible values: "Enabled" or + * "Disabled". + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPublicNetworkAccess(String publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + public List regionDetails() { + return this.innerProperties() == null ? null : this.innerProperties().regionDetails(); + } + + /** + * Set the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails the regionDetails value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withRegionDetails(List regionDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withRegionDetails(regionDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model RegistryInner")); + } else { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryInner.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..20b118c719685 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Private Endpoint Connection. */ +@Fluent +public final class RegistryPrivateEndpointConnectionProperties { + /* + * The group ids + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /* + * The PE network resource that is linked to this PE connection. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpointResource privateEndpoint; + + /* + * The connection state. + */ + @JsonProperty(value = "registryPrivateLinkServiceConnectionState") + private RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState; + + /* + * One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** Creates an instance of RegistryPrivateEndpointConnectionProperties class. */ + public RegistryPrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: The group ids. + * + * @param groupIds the groupIds value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Get the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointResource privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpointResource privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @return the registryPrivateLinkServiceConnectionState value. + */ + public RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState() { + return this.registryPrivateLinkServiceConnectionState; + } + + /** + * Set the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @param registryPrivateLinkServiceConnectionState the registryPrivateLinkServiceConnectionState value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withRegistryPrivateLinkServiceConnectionState( + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState) { + this.registryPrivateLinkServiceConnectionState = registryPrivateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @param provisioningState the provisioningState value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (registryPrivateLinkServiceConnectionState() != null) { + registryPrivateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java new file mode 100644 index 0000000000000..a8ae4826d3214 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of the Registry. */ +@Fluent +public final class RegistryProperties { + /* + * Discovery URL for the Registry + */ + @JsonProperty(value = "discoveryUrl") + private String discoveryUrl; + + /* + * IntellectualPropertyPublisher for the registry + */ + @JsonProperty(value = "intellectualPropertyPublisher") + private String intellectualPropertyPublisher; + + /* + * ResourceId of the managed RG if the registry has system created resources + */ + @JsonProperty(value = "managedResourceGroup") + private ArmResourceId managedResourceGroup; + + /* + * MLFlow Registry URI for the Registry + */ + @JsonProperty(value = "mlFlowRegistryUri") + private String mlFlowRegistryUri; + + /* + * Private endpoint connections info used for pending connections in private link portal + */ + @JsonProperty(value = "registryPrivateEndpointConnections") + private List registryPrivateEndpointConnections; + + /* + * Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled" + */ + @JsonProperty(value = "publicNetworkAccess") + private String publicNetworkAccess; + + /* + * Details of each region the registry is in + */ + @JsonProperty(value = "regionDetails") + private List regionDetails; + + /** Creates an instance of RegistryProperties class. */ + public RegistryProperties() { + } + + /** + * Get the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + public String discoveryUrl() { + return this.discoveryUrl; + } + + /** + * Set the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl the discoveryUrl value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withDiscoveryUrl(String discoveryUrl) { + this.discoveryUrl = discoveryUrl; + return this; + } + + /** + * Get the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + public String intellectualPropertyPublisher() { + return this.intellectualPropertyPublisher; + } + + /** + * Set the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher the intellectualPropertyPublisher value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + this.intellectualPropertyPublisher = intellectualPropertyPublisher; + return this; + } + + /** + * Get the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @return the managedResourceGroup value. + */ + public ArmResourceId managedResourceGroup() { + return this.managedResourceGroup; + } + + /** + * Set the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @param managedResourceGroup the managedResourceGroup value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withManagedResourceGroup(ArmResourceId managedResourceGroup) { + this.managedResourceGroup = managedResourceGroup; + return this; + } + + /** + * Get the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + public String mlFlowRegistryUri() { + return this.mlFlowRegistryUri; + } + + /** + * Set the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri the mlFlowRegistryUri value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withMlFlowRegistryUri(String mlFlowRegistryUri) { + this.mlFlowRegistryUri = mlFlowRegistryUri; + return this; + } + + /** + * Get the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + public List registryPrivateEndpointConnections() { + return this.registryPrivateEndpointConnections; + } + + /** + * Set the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @param registryPrivateEndpointConnections the registryPrivateEndpointConnections value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + this.registryPrivateEndpointConnections = registryPrivateEndpointConnections; + return this; + } + + /** + * Get the publicNetworkAccess property: Is the Registry accessible from the internet? Possible values: "Enabled" or + * "Disabled". + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Is the Registry accessible from the internet? Possible values: "Enabled" or + * "Disabled". + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPublicNetworkAccess(String publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + public List regionDetails() { + return this.regionDetails; + } + + /** + * Set the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails the regionDetails value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withRegionDetails(List regionDetails) { + this.regionDetails = regionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedResourceGroup() != null) { + managedResourceGroup().validate(); + } + if (registryPrivateEndpointConnections() != null) { + registryPrivateEndpointConnections().forEach(e -> e.validate()); + } + if (regionDetails() != null) { + regionDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java index 958d5005f9a12..392f01e8a1ac4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java @@ -5,77 +5,77 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; import com.fasterxml.jackson.annotation.JsonProperty; /** Properties of a shared private link resource. */ @Fluent public final class SharedPrivateLinkResourceProperty { /* - * The resource id that private link links to. + * group id of the private link */ - @JsonProperty(value = "privateLinkResourceId") - private String privateLinkResourceId; + @JsonProperty(value = "groupId") + private String groupId; /* - * The private link resource group id. + * the resource id that private link links to */ - @JsonProperty(value = "groupId") - private String groupId; + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; /* - * Request message. + * Request message */ @JsonProperty(value = "requestMessage") private String requestMessage; /* - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + * Connection status of the service consumer with the service provider */ @JsonProperty(value = "status") - private PrivateEndpointServiceConnectionStatus status; + private EndpointServiceConnectionStatus status; /** Creates an instance of SharedPrivateLinkResourceProperty class. */ public SharedPrivateLinkResourceProperty() { } /** - * Get the privateLinkResourceId property: The resource id that private link links to. + * Get the groupId property: group id of the private link. * - * @return the privateLinkResourceId value. + * @return the groupId value. */ - public String privateLinkResourceId() { - return this.privateLinkResourceId; + public String groupId() { + return this.groupId; } /** - * Set the privateLinkResourceId property: The resource id that private link links to. + * Set the groupId property: group id of the private link. * - * @param privateLinkResourceId the privateLinkResourceId value to set. + * @param groupId the groupId value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ - public SharedPrivateLinkResourceProperty withPrivateLinkResourceId(String privateLinkResourceId) { - this.privateLinkResourceId = privateLinkResourceId; + public SharedPrivateLinkResourceProperty withGroupId(String groupId) { + this.groupId = groupId; return this; } /** - * Get the groupId property: The private link resource group id. + * Get the privateLinkResourceId property: the resource id that private link links to. * - * @return the groupId value. + * @return the privateLinkResourceId value. */ - public String groupId() { - return this.groupId; + public String privateLinkResourceId() { + return this.privateLinkResourceId; } /** - * Set the groupId property: The private link resource group id. + * Set the privateLinkResourceId property: the resource id that private link links to. * - * @param groupId the groupId value to set. + * @param privateLinkResourceId the privateLinkResourceId value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ - public SharedPrivateLinkResourceProperty withGroupId(String groupId) { - this.groupId = groupId; + public SharedPrivateLinkResourceProperty withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; return this; } @@ -100,23 +100,21 @@ public SharedPrivateLinkResourceProperty withRequestMessage(String requestMessag } /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Get the status property: Connection status of the service consumer with the service provider. * * @return the status value. */ - public PrivateEndpointServiceConnectionStatus status() { + public EndpointServiceConnectionStatus status() { return this.status; } /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Set the status property: Connection status of the service consumer with the service provider. * * @param status the status value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ - public SharedPrivateLinkResourceProperty withStatus(PrivateEndpointServiceConnectionStatus status) { + public SharedPrivateLinkResourceProperty withStatus(EndpointServiceConnectionStatus status) { this.status = status; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java index 0574f791c1fea..d490c29bfb715 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java @@ -7,13 +7,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -23,36 +26,42 @@ @Fluent public final class WorkspaceInner extends ProxyResource { /* - * The properties of the machine learning workspace. + * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "properties") - private WorkspacePropertiesInner innerProperties; + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; /* - * The identity of the resource. + * The kind property. */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; + @JsonProperty(value = "kind") + private String kind; /* - * Specifies the location of the resource. + * The location property. */ @JsonProperty(value = "location") private String location; /* - * Contains resource tags defined as key/value pairs. + * Additional attributes of the entity. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; + @JsonProperty(value = "properties", required = true) + private WorkspacePropertiesInner innerProperties = new WorkspacePropertiesInner(); /* - * The sku of the workspace. + * Optional. This field is required to be implemented by the RP because AML is supporting more than one tier */ @JsonProperty(value = "sku") private Sku sku; + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -64,16 +73,7 @@ public WorkspaceInner() { } /** - * Get the innerProperties property: The properties of the machine learning workspace. - * - * @return the innerProperties value. - */ - private WorkspacePropertiesInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the identity property: The identity of the resource. + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ @@ -82,7 +82,7 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: The identity of the resource. + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). * * @param identity the identity value to set. * @return the WorkspaceInner object itself. @@ -93,47 +93,57 @@ public WorkspaceInner withIdentity(ManagedServiceIdentity identity) { } /** - * Get the location property: Specifies the location of the resource. + * Get the kind property: The kind property. * - * @return the location value. + * @return the kind value. */ - public String location() { - return this.location; + public String kind() { + return this.kind; } /** - * Set the location property: Specifies the location of the resource. + * Set the kind property: The kind property. * - * @param location the location value to set. + * @param kind the kind value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withLocation(String location) { - this.location = location; + public WorkspaceInner withKind(String kind) { + this.kind = kind; return this; } /** - * Get the tags property: Contains resource tags defined as key/value pairs. + * Get the location property: The location property. * - * @return the tags value. + * @return the location value. */ - public Map tags() { - return this.tags; + public String location() { + return this.location; } /** - * Set the tags property: Contains resource tags defined as key/value pairs. + * Set the location property: The location property. * - * @param tags the tags value to set. + * @param location the location value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withTags(Map tags) { - this.tags = tags; + public WorkspaceInner withLocation(String location) { + this.location = location; return this; } /** - * Get the sku property: The sku of the workspace. + * Get the innerProperties property: Additional attributes of the entity. + * + * @return the innerProperties value. + */ + private WorkspacePropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * * @return the sku value. */ @@ -142,7 +152,8 @@ public Sku sku() { } /** - * Set the sku property: The sku of the workspace. + * Set the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * * @param sku the sku value to set. * @return the WorkspaceInner object itself. @@ -153,114 +164,125 @@ public WorkspaceInner withSku(Sku sku) { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the tags property: Dictionary of <string>. * - * @return the systemData value. + * @return the tags value. */ - public SystemData systemData() { - return this.systemData; + public Map tags() { + return this.tags; } /** - * Get the workspaceId property: The immutable id associated with this workspace. + * Set the tags property: Dictionary of <string>. * - * @return the workspaceId value. + * @param tags the tags value to set. + * @return the WorkspaceInner object itself. */ - public String workspaceId() { - return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); + public WorkspaceInner withTags(Map tags) { + this.tags = tags; + return this; } /** - * Get the description property: The description of this workspace. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the description value. + * @return the systemData value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public SystemData systemData() { + return this.systemData; } /** - * Set the description property: The description of this workspace. + * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind + * VNet. * - * @param description the description value to set. + * @return the allowPublicAccessWhenBehindVnet value. + */ + public Boolean allowPublicAccessWhenBehindVnet() { + return this.innerProperties() == null ? null : this.innerProperties().allowPublicAccessWhenBehindVnet(); + } + + /** + * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind + * VNet. + * + * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withDescription(String description) { + public WorkspaceInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withDescription(description); + this.innerProperties().withAllowPublicAccessWhenBehindVnet(allowPublicAccessWhenBehindVnet); return this; } /** - * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @return the friendlyName value. + * @return the applicationInsights value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + public String applicationInsights() { + return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); } /** - * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @param friendlyName the friendlyName value to set. + * @param applicationInsights the applicationInsights value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withFriendlyName(String friendlyName) { + public WorkspaceInner withApplicationInsights(String applicationInsights) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withFriendlyName(friendlyName); + this.innerProperties().withApplicationInsights(applicationInsights); return this; } /** - * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Get the associatedWorkspaces property: The associatedWorkspaces property. * - * @return the keyVault value. + * @return the associatedWorkspaces value. */ - public String keyVault() { - return this.innerProperties() == null ? null : this.innerProperties().keyVault(); + public List associatedWorkspaces() { + return this.innerProperties() == null ? null : this.innerProperties().associatedWorkspaces(); } /** - * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Set the associatedWorkspaces property: The associatedWorkspaces property. * - * @param keyVault the keyVault value to set. + * @param associatedWorkspaces the associatedWorkspaces value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withKeyVault(String keyVault) { + public WorkspaceInner withAssociatedWorkspaces(List associatedWorkspaces) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withKeyVault(keyVault); + this.innerProperties().withAssociatedWorkspaces(associatedWorkspaces); return this; } /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * Get the containerRegistries property: The containerRegistries property. * - * @return the applicationInsights value. + * @return the containerRegistries value. */ - public String applicationInsights() { - return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); + public List containerRegistries() { + return this.innerProperties() == null ? null : this.innerProperties().containerRegistries(); } /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * Set the containerRegistries property: The containerRegistries property. * - * @param applicationInsights the applicationInsights value to set. + * @param containerRegistries the containerRegistries value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withApplicationInsights(String applicationInsights) { + public WorkspaceInner withContainerRegistries(List containerRegistries) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withApplicationInsights(applicationInsights); + this.innerProperties().withContainerRegistries(containerRegistries); return this; } @@ -288,27 +310,25 @@ public WorkspaceInner withContainerRegistry(String containerRegistry) { } /** - * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Get the description property: The description of this workspace. * - * @return the storageAccount value. + * @return the description value. */ - public String storageAccount() { - return this.innerProperties() == null ? null : this.innerProperties().storageAccount(); + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** - * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Set the description property: The description of this workspace. * - * @param storageAccount the storageAccount value to set. + * @param description the description value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withStorageAccount(String storageAccount) { + public WorkspaceInner withDescription(String description) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withStorageAccount(storageAccount); + this.innerProperties().withDescription(description); return this; } @@ -338,17 +358,30 @@ public WorkspaceInner withDiscoveryUrl(String discoveryUrl) { } /** - * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is - * to indicate states for resource provisioning. + * Get the enableDataIsolation property: The enableDataIsolation property. * - * @return the provisioningState value. + * @return the enableDataIsolation value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public Boolean enableDataIsolation() { + return this.innerProperties() == null ? null : this.innerProperties().enableDataIsolation(); } /** - * Get the encryption property: The encryption settings of Azure ML workspace. + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withEnableDataIsolation(Boolean enableDataIsolation) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withEnableDataIsolation(enableDataIsolation); + return this; + } + + /** + * Get the encryption property: The encryption property. * * @return the encryption value. */ @@ -357,7 +390,7 @@ public EncryptionProperty encryption() { } /** - * Set the encryption property: The encryption settings of Azure ML workspace. + * Set the encryption property: The encryption property. * * @param encryption the encryption value to set. * @return the WorkspaceInner object itself. @@ -370,6 +403,75 @@ public WorkspaceInner withEncryption(EncryptionProperty encryption) { return this; } + /** + * Get the existingWorkspaces property: The existingWorkspaces property. + * + * @return the existingWorkspaces value. + */ + public List existingWorkspaces() { + return this.innerProperties() == null ? null : this.innerProperties().existingWorkspaces(); + } + + /** + * Set the existingWorkspaces property: The existingWorkspaces property. + * + * @param existingWorkspaces the existingWorkspaces value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withExistingWorkspaces(List existingWorkspaces) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withExistingWorkspaces(existingWorkspaces); + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.innerProperties() == null ? null : this.innerProperties().featureStoreSettings(); + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withFeatureStoreSettings(featureStoreSettings); + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + /** * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. @@ -396,22 +498,26 @@ public WorkspaceInner withHbiWorkspace(Boolean hbiWorkspace) { } /** - * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP - * in customer subscription if the workspace is CMK workspace. + * Get the hubResourceId property: The hubResourceId property. * - * @return the serviceProvisionedResourceGroup value. + * @return the hubResourceId value. */ - public String serviceProvisionedResourceGroup() { - return this.innerProperties() == null ? null : this.innerProperties().serviceProvisionedResourceGroup(); + public String hubResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().hubResourceId(); } /** - * Get the privateLinkCount property: Count of private connections in the workspace. + * Set the hubResourceId property: The hubResourceId property. * - * @return the privateLinkCount value. + * @param hubResourceId the hubResourceId value to set. + * @return the WorkspaceInner object itself. */ - public Integer privateLinkCount() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkCount(); + public WorkspaceInner withHubResourceId(String hubResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withHubResourceId(hubResourceId); + return this; } /** @@ -438,92 +544,169 @@ public WorkspaceInner withImageBuildCompute(String imageBuildCompute) { } /** - * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind - * VNet. + * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @return the allowPublicAccessWhenBehindVnet value. + * @return the keyVault value. */ - public Boolean allowPublicAccessWhenBehindVnet() { - return this.innerProperties() == null ? null : this.innerProperties().allowPublicAccessWhenBehindVnet(); + public String keyVault() { + return this.innerProperties() == null ? null : this.innerProperties().keyVault(); } /** - * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind - * VNet. + * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. + * @param keyVault the keyVault value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { + public WorkspaceInner withKeyVault(String keyVault) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withAllowPublicAccessWhenBehindVnet(allowPublicAccessWhenBehindVnet); + this.innerProperties().withKeyVault(keyVault); return this; } /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Get the keyVaults property: The keyVaults property. * - * @return the publicNetworkAccess value. + * @return the keyVaults value. */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + public List keyVaults() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaults(); } /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Set the keyVaults property: The keyVaults property. * - * @param publicNetworkAccess the publicNetworkAccess value to set. + * @param keyVaults the keyVaults value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public WorkspaceInner withKeyVaults(List keyVaults) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + this.innerProperties().withKeyVaults(keyVaults); return this; } /** - * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the privateEndpointConnections value. + * @return the managedNetwork value. */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + public ManagedNetworkSettingsInner managedNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().managedNetwork(); } /** - * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the sharedPrivateLinkResources value. + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspaceInner object itself. */ - public List sharedPrivateLinkResources() { - return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResources(); + public WorkspaceInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withManagedNetwork(managedNetwork); + return this; } /** - * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point + * at to set up tracking. * - * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. + * @return the mlFlowTrackingUri value. + */ + public String mlFlowTrackingUri() { + return this.innerProperties() == null ? null : this.innerProperties().mlFlowTrackingUri(); + } + + /** + * Get the notebookInfo property: The notebook info of Azure ML workspace. + * + * @return the notebookInfo value. + */ + public NotebookResourceInfoInner notebookInfo() { + return this.innerProperties() == null ? null : this.innerProperties().notebookInfo(); + } + + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withSharedPrivateLinkResources(List sharedPrivateLinkResources) { + public WorkspaceInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withSharedPrivateLinkResources(sharedPrivateLinkResources); + this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); return this; } /** - * Get the notebookInfo property: The notebook info of Azure ML workspace. + * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. * - * @return the notebookInfo value. + * @return the privateEndpointConnections value. */ - public NotebookResourceInfoInner notebookInfo() { - return this.innerProperties() == null ? null : this.innerProperties().notebookInfo(); + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the privateLinkCount property: Count of private connections in the workspace. + * + * @return the privateLinkCount value. + */ + public Integer privateLinkCount() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkCount(); + } + + /** + * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is + * to indicate states for resource provisioning. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; } /** @@ -551,37 +734,107 @@ public WorkspaceInner withServiceManagedResourcesSettings( } /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP + * in customer subscription if the workspace is CMK workspace. * - * @return the primaryUserAssignedIdentity value. + * @return the serviceProvisionedResourceGroup value. */ - public String primaryUserAssignedIdentity() { - return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); + public String serviceProvisionedResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().serviceProvisionedResourceGroup(); } /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the sharedPrivateLinkResources value. + */ + public List sharedPrivateLinkResources() { + return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResources(); + } + + /** + * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * + * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. * @return the WorkspaceInner object itself. */ - public WorkspaceInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + public WorkspaceInner withSharedPrivateLinkResources(List sharedPrivateLinkResources) { if (this.innerProperties() == null) { this.innerProperties = new WorkspacePropertiesInner(); } - this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + this.innerProperties().withSharedPrivateLinkResources(sharedPrivateLinkResources); return this; } /** - * Get the tenantId property: The tenant id associated with this workspace. + * Get the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. * - * @return the tenantId value. + * @return the softDeleteRetentionInDays value. */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + public Integer softDeleteRetentionInDays() { + return this.innerProperties() == null ? null : this.innerProperties().softDeleteRetentionInDays(); + } + + /** + * Set the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withSoftDeleteRetentionInDays(softDeleteRetentionInDays); + return this; + } + + /** + * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @return the storageAccount value. + */ + public String storageAccount() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccount(); + } + + /** + * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @param storageAccount the storageAccount value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withStorageAccount(String storageAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withStorageAccount(storageAccount); + return this; + } + + /** + * Get the storageAccounts property: The storageAccounts property. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccounts(); + } + + /** + * Set the storageAccounts property: The storageAccounts property. + * + * @param storageAccounts the storageAccounts value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withStorageAccounts(List storageAccounts) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withStorageAccounts(storageAccounts); + return this; } /** @@ -595,13 +848,37 @@ public Boolean storageHnsEnabled() { } /** - * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point - * at to set up tracking. + * Get the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. * - * @return the mlFlowTrackingUri value. + * @return the systemDatastoresAuthMode value. */ - public String mlFlowTrackingUri() { - return this.innerProperties() == null ? null : this.innerProperties().mlFlowTrackingUri(); + public String systemDatastoresAuthMode() { + return this.innerProperties() == null ? null : this.innerProperties().systemDatastoresAuthMode(); + } + + /** + * Set the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. + * + * @param systemDatastoresAuthMode the systemDatastoresAuthMode value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSystemDatastoresAuthMode(String systemDatastoresAuthMode) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withSystemDatastoresAuthMode(systemDatastoresAuthMode); + return this; + } + + /** + * Get the tenantId property: The tenant id associated with this workspace. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** @@ -629,20 +906,58 @@ public WorkspaceInner withV1LegacyMode(Boolean v1LegacyMode) { return this; } + /** + * Get the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceHubConfig(); + } + + /** + * Set the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @param workspaceHubConfig the workspaceHubConfig value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withWorkspaceHubConfig(workspaceHubConfig); + return this; + } + + /** + * Get the workspaceId property: The immutable id associated with this workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } if (identity() != null) { identity().validate(); } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model WorkspaceInner")); + } else { + innerProperties().validate(); + } if (sku() != null) { sku().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceInner.class); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java index 147434b8ed519..5e05149e4625a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java @@ -6,10 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,35 +19,28 @@ @Fluent public final class WorkspacePropertiesInner { /* - * The immutable id associated with this workspace. - */ - @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) - private String workspaceId; - - /* - * The description of this workspace. + * The flag to indicate whether to allow public access when behind VNet. */ - @JsonProperty(value = "description") - private String description; + @JsonProperty(value = "allowPublicAccessWhenBehindVnet") + private Boolean allowPublicAccessWhenBehindVnet; /* - * The friendly name for this workspace. This name in mutable + * ARM id of the application insights associated with this workspace. */ - @JsonProperty(value = "friendlyName") - private String friendlyName; + @JsonProperty(value = "applicationInsights") + private String applicationInsights; /* - * ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been - * created + * The associatedWorkspaces property. */ - @JsonProperty(value = "keyVault") - private String keyVault; + @JsonProperty(value = "associatedWorkspaces") + private List associatedWorkspaces; /* - * ARM id of the application insights associated with this workspace. + * The containerRegistries property. */ - @JsonProperty(value = "applicationInsights") - private String applicationInsights; + @JsonProperty(value = "containerRegistries") + private List containerRegistries; /* * ARM id of the container registry associated with this workspace. @@ -54,11 +49,10 @@ public final class WorkspacePropertiesInner { private String containerRegistry; /* - * ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been - * created + * The description of this workspace. */ - @JsonProperty(value = "storageAccount") - private String storageAccount; + @JsonProperty(value = "description") + private String description; /* * Url for the discovery service to identify regional endpoints for machine learning experimentation services @@ -67,36 +61,46 @@ public final class WorkspacePropertiesInner { private String discoveryUrl; /* - * The current deployment state of workspace resource. The provisioningState is to indicate states for resource - * provisioning. + * The enableDataIsolation property. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + @JsonProperty(value = "enableDataIsolation") + private Boolean enableDataIsolation; /* - * The encryption settings of Azure ML workspace. + * The encryption property. */ @JsonProperty(value = "encryption") private EncryptionProperty encryption; /* - * The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + * The existingWorkspaces property. */ - @JsonProperty(value = "hbiWorkspace") - private Boolean hbiWorkspace; + @JsonProperty(value = "existingWorkspaces") + private List existingWorkspaces; /* - * The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK - * workspace + * Settings for feature store type workspace. */ - @JsonProperty(value = "serviceProvisionedResourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String serviceProvisionedResourceGroup; + @JsonProperty(value = "featureStoreSettings") + private FeatureStoreSettings featureStoreSettings; /* - * Count of private connections in the workspace + * The friendly name for this workspace. This name in mutable */ - @JsonProperty(value = "privateLinkCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer privateLinkCount; + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + */ + @JsonProperty(value = "hbiWorkspace") + private Boolean hbiWorkspace; + + /* + * The hubResourceId property. + */ + @JsonProperty(value = "hubResourceId") + private String hubResourceId; /* * The compute name for image build @@ -105,28 +109,29 @@ public final class WorkspacePropertiesInner { private String imageBuildCompute; /* - * The flag to indicate whether to allow public access when behind VNet. + * ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been + * created */ - @JsonProperty(value = "allowPublicAccessWhenBehindVnet") - private Boolean allowPublicAccessWhenBehindVnet; + @JsonProperty(value = "keyVault") + private String keyVault; /* - * Whether requests from Public Network are allowed. + * The keyVaults property. */ - @JsonProperty(value = "publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; + @JsonProperty(value = "keyVaults") + private List keyVaults; /* - * The list of private endpoint connections in the workspace. + * Managed Network settings for a machine learning workspace. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "managedNetwork") + private ManagedNetworkSettingsInner managedNetwork; /* - * The list of shared private link resources in this workspace. + * The URI associated with this workspace that machine learning flow must point at to set up tracking. */ - @JsonProperty(value = "sharedPrivateLinkResources") - private List sharedPrivateLinkResources; + @JsonProperty(value = "mlFlowTrackingUri", access = JsonProperty.Access.WRITE_ONLY) + private String mlFlowTrackingUri; /* * The notebook info of Azure ML workspace. @@ -134,6 +139,37 @@ public final class WorkspacePropertiesInner { @JsonProperty(value = "notebookInfo", access = JsonProperty.Access.WRITE_ONLY) private NotebookResourceInfoInner notebookInfo; + /* + * The user assigned identity resource id that represents the workspace identity. + */ + @JsonProperty(value = "primaryUserAssignedIdentity") + private String primaryUserAssignedIdentity; + + /* + * The list of private endpoint connections in the workspace. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Count of private connections in the workspace + */ + @JsonProperty(value = "privateLinkCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer privateLinkCount; + + /* + * The current deployment state of workspace resource. The provisioningState is to indicate states for resource + * provisioning. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Whether requests from Public Network are allowed. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccessType publicNetworkAccess; + /* * The service managed resource settings. */ @@ -141,16 +177,36 @@ public final class WorkspacePropertiesInner { private ServiceManagedResourcesSettings serviceManagedResourcesSettings; /* - * The user assigned identity resource id that represents the workspace identity. + * The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK + * workspace */ - @JsonProperty(value = "primaryUserAssignedIdentity") - private String primaryUserAssignedIdentity; + @JsonProperty(value = "serviceProvisionedResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String serviceProvisionedResourceGroup; /* - * The tenant id associated with this workspace. + * The list of shared private link resources in this workspace. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; + @JsonProperty(value = "sharedPrivateLinkResources") + private List sharedPrivateLinkResources; + + /* + * Retention time in days after workspace get soft deleted. + */ + @JsonProperty(value = "softDeleteRetentionInDays") + private Integer softDeleteRetentionInDays; + + /* + * ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been + * created + */ + @JsonProperty(value = "storageAccount") + private String storageAccount; + + /* + * The storageAccounts property. + */ + @JsonProperty(value = "storageAccounts") + private List storageAccounts; /* * If the storage associated with the workspace has hierarchical namespace(HNS) enabled. @@ -159,10 +215,16 @@ public final class WorkspacePropertiesInner { private Boolean storageHnsEnabled; /* - * The URI associated with this workspace that machine learning flow must point at to set up tracking. + * The auth mode used for accessing the system datastores of the workspace. */ - @JsonProperty(value = "mlFlowTrackingUri", access = JsonProperty.Access.WRITE_ONLY) - private String mlFlowTrackingUri; + @JsonProperty(value = "systemDatastoresAuthMode") + private String systemDatastoresAuthMode; + + /* + * The tenant id associated with this workspace. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; /* * Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. @@ -170,98 +232,101 @@ public final class WorkspacePropertiesInner { @JsonProperty(value = "v1LegacyMode") private Boolean v1LegacyMode; - /** Creates an instance of WorkspacePropertiesInner class. */ - public WorkspacePropertiesInner() { - } + /* + * WorkspaceHub's configuration object. + */ + @JsonProperty(value = "workspaceHubConfig") + private WorkspaceHubConfig workspaceHubConfig; - /** - * Get the workspaceId property: The immutable id associated with this workspace. - * - * @return the workspaceId value. + /* + * The immutable id associated with this workspace. */ - public String workspaceId() { - return this.workspaceId; + @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceId; + + /** Creates an instance of WorkspacePropertiesInner class. */ + public WorkspacePropertiesInner() { } /** - * Get the description property: The description of this workspace. + * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind + * VNet. * - * @return the description value. + * @return the allowPublicAccessWhenBehindVnet value. */ - public String description() { - return this.description; + public Boolean allowPublicAccessWhenBehindVnet() { + return this.allowPublicAccessWhenBehindVnet; } /** - * Set the description property: The description of this workspace. + * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind + * VNet. * - * @param description the description value to set. + * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withDescription(String description) { - this.description = description; + public WorkspacePropertiesInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { + this.allowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; return this; } /** - * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @return the friendlyName value. + * @return the applicationInsights value. */ - public String friendlyName() { - return this.friendlyName; + public String applicationInsights() { + return this.applicationInsights; } /** - * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @param friendlyName the friendlyName value to set. + * @param applicationInsights the applicationInsights value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; + public WorkspacePropertiesInner withApplicationInsights(String applicationInsights) { + this.applicationInsights = applicationInsights; return this; } /** - * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Get the associatedWorkspaces property: The associatedWorkspaces property. * - * @return the keyVault value. + * @return the associatedWorkspaces value. */ - public String keyVault() { - return this.keyVault; + public List associatedWorkspaces() { + return this.associatedWorkspaces; } /** - * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Set the associatedWorkspaces property: The associatedWorkspaces property. * - * @param keyVault the keyVault value to set. + * @param associatedWorkspaces the associatedWorkspaces value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withKeyVault(String keyVault) { - this.keyVault = keyVault; + public WorkspacePropertiesInner withAssociatedWorkspaces(List associatedWorkspaces) { + this.associatedWorkspaces = associatedWorkspaces; return this; } /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * Get the containerRegistries property: The containerRegistries property. * - * @return the applicationInsights value. + * @return the containerRegistries value. */ - public String applicationInsights() { - return this.applicationInsights; + public List containerRegistries() { + return this.containerRegistries; } /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * Set the containerRegistries property: The containerRegistries property. * - * @param applicationInsights the applicationInsights value to set. + * @param containerRegistries the containerRegistries value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withApplicationInsights(String applicationInsights) { - this.applicationInsights = applicationInsights; + public WorkspacePropertiesInner withContainerRegistries(List containerRegistries) { + this.containerRegistries = containerRegistries; return this; } @@ -286,24 +351,22 @@ public WorkspacePropertiesInner withContainerRegistry(String containerRegistry) } /** - * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Get the description property: The description of this workspace. * - * @return the storageAccount value. + * @return the description value. */ - public String storageAccount() { - return this.storageAccount; + public String description() { + return this.description; } /** - * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Set the description property: The description of this workspace. * - * @param storageAccount the storageAccount value to set. + * @param description the description value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withStorageAccount(String storageAccount) { - this.storageAccount = storageAccount; + public WorkspacePropertiesInner withDescription(String description) { + this.description = description; return this; } @@ -330,17 +393,27 @@ public WorkspacePropertiesInner withDiscoveryUrl(String discoveryUrl) { } /** - * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is - * to indicate states for resource provisioning. + * Get the enableDataIsolation property: The enableDataIsolation property. * - * @return the provisioningState value. + * @return the enableDataIsolation value. */ - public ProvisioningState provisioningState() { - return this.provisioningState; + public Boolean enableDataIsolation() { + return this.enableDataIsolation; + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withEnableDataIsolation(Boolean enableDataIsolation) { + this.enableDataIsolation = enableDataIsolation; + return this; } /** - * Get the encryption property: The encryption settings of Azure ML workspace. + * Get the encryption property: The encryption property. * * @return the encryption value. */ @@ -349,7 +422,7 @@ public EncryptionProperty encryption() { } /** - * Set the encryption property: The encryption settings of Azure ML workspace. + * Set the encryption property: The encryption property. * * @param encryption the encryption value to set. * @return the WorkspacePropertiesInner object itself. @@ -360,44 +433,105 @@ public WorkspacePropertiesInner withEncryption(EncryptionProperty encryption) { } /** - * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected - * by the service. + * Get the existingWorkspaces property: The existingWorkspaces property. * - * @return the hbiWorkspace value. + * @return the existingWorkspaces value. */ - public Boolean hbiWorkspace() { - return this.hbiWorkspace; + public List existingWorkspaces() { + return this.existingWorkspaces; } /** - * Set the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected - * by the service. + * Set the existingWorkspaces property: The existingWorkspaces property. * - * @param hbiWorkspace the hbiWorkspace value to set. + * @param existingWorkspaces the existingWorkspaces value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withHbiWorkspace(Boolean hbiWorkspace) { - this.hbiWorkspace = hbiWorkspace; + public WorkspacePropertiesInner withExistingWorkspaces(List existingWorkspaces) { + this.existingWorkspaces = existingWorkspaces; return this; } /** - * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP - * in customer subscription if the workspace is CMK workspace. + * Get the featureStoreSettings property: Settings for feature store type workspace. * - * @return the serviceProvisionedResourceGroup value. + * @return the featureStoreSettings value. */ - public String serviceProvisionedResourceGroup() { - return this.serviceProvisionedResourceGroup; + public FeatureStoreSettings featureStoreSettings() { + return this.featureStoreSettings; } /** - * Get the privateLinkCount property: Count of private connections in the workspace. + * Set the featureStoreSettings property: Settings for feature store type workspace. * - * @return the privateLinkCount value. + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspacePropertiesInner object itself. */ - public Integer privateLinkCount() { - return this.privateLinkCount; + public WorkspacePropertiesInner withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + this.featureStoreSettings = featureStoreSettings; + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected + * by the service. + * + * @return the hbiWorkspace value. + */ + public Boolean hbiWorkspace() { + return this.hbiWorkspace; + } + + /** + * Set the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected + * by the service. + * + * @param hbiWorkspace the hbiWorkspace value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withHbiWorkspace(Boolean hbiWorkspace) { + this.hbiWorkspace = hbiWorkspace; + return this; + } + + /** + * Get the hubResourceId property: The hubResourceId property. + * + * @return the hubResourceId value. + */ + public String hubResourceId() { + return this.hubResourceId; + } + + /** + * Set the hubResourceId property: The hubResourceId property. + * + * @param hubResourceId the hubResourceId value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withHubResourceId(String hubResourceId) { + this.hubResourceId = hubResourceId; + return this; } /** @@ -421,75 +555,75 @@ public WorkspacePropertiesInner withImageBuildCompute(String imageBuildCompute) } /** - * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind - * VNet. + * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @return the allowPublicAccessWhenBehindVnet value. + * @return the keyVault value. */ - public Boolean allowPublicAccessWhenBehindVnet() { - return this.allowPublicAccessWhenBehindVnet; + public String keyVault() { + return this.keyVault; } /** - * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind - * VNet. + * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. + * @param keyVault the keyVault value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { - this.allowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + public WorkspacePropertiesInner withKeyVault(String keyVault) { + this.keyVault = keyVault; return this; } /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Get the keyVaults property: The keyVaults property. * - * @return the publicNetworkAccess value. + * @return the keyVaults value. */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; + public List keyVaults() { + return this.keyVaults; } /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Set the keyVaults property: The keyVaults property. * - * @param publicNetworkAccess the publicNetworkAccess value to set. + * @param keyVaults the keyVaults value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; + public WorkspacePropertiesInner withKeyVaults(List keyVaults) { + this.keyVaults = keyVaults; return this; } /** - * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the privateEndpointConnections value. + * @return the managedNetwork value. */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; + public ManagedNetworkSettingsInner managedNetwork() { + return this.managedNetwork; } /** - * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the sharedPrivateLinkResources value. + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspacePropertiesInner object itself. */ - public List sharedPrivateLinkResources() { - return this.sharedPrivateLinkResources; + public WorkspacePropertiesInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + this.managedNetwork = managedNetwork; + return this; } /** - * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point + * at to set up tracking. * - * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. - * @return the WorkspacePropertiesInner object itself. + * @return the mlFlowTrackingUri value. */ - public WorkspacePropertiesInner withSharedPrivateLinkResources( - List sharedPrivateLinkResources) { - this.sharedPrivateLinkResources = sharedPrivateLinkResources; - return this; + public String mlFlowTrackingUri() { + return this.mlFlowTrackingUri; } /** @@ -501,6 +635,76 @@ public NotebookResourceInfoInner notebookInfo() { return this.notebookInfo; } + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.primaryUserAssignedIdentity; + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; + return this; + } + + /** + * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the privateLinkCount property: Count of private connections in the workspace. + * + * @return the privateLinkCount value. + */ + public Integer privateLinkCount() { + return this.privateLinkCount; + } + + /** + * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is + * to indicate states for resource provisioning. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Get the serviceManagedResourcesSettings property: The service managed resource settings. * @@ -523,34 +727,96 @@ public WorkspacePropertiesInner withServiceManagedResourcesSettings( } /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP + * in customer subscription if the workspace is CMK workspace. * - * @return the primaryUserAssignedIdentity value. + * @return the serviceProvisionedResourceGroup value. */ - public String primaryUserAssignedIdentity() { - return this.primaryUserAssignedIdentity; + public String serviceProvisionedResourceGroup() { + return this.serviceProvisionedResourceGroup; } /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the sharedPrivateLinkResources value. + */ + public List sharedPrivateLinkResources() { + return this.sharedPrivateLinkResources; + } + + /** + * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * + * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { - this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; + public WorkspacePropertiesInner withSharedPrivateLinkResources( + List sharedPrivateLinkResources) { + this.sharedPrivateLinkResources = sharedPrivateLinkResources; return this; } /** - * Get the tenantId property: The tenant id associated with this workspace. + * Get the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. * - * @return the tenantId value. + * @return the softDeleteRetentionInDays value. */ - public String tenantId() { - return this.tenantId; + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + this.softDeleteRetentionInDays = softDeleteRetentionInDays; + return this; + } + + /** + * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @return the storageAccount value. + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @param storageAccount the storageAccount value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the storageAccounts property: The storageAccounts property. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The storageAccounts property. + * + * @param storageAccounts the storageAccounts value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; } /** @@ -564,13 +830,34 @@ public Boolean storageHnsEnabled() { } /** - * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point - * at to set up tracking. + * Get the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. * - * @return the mlFlowTrackingUri value. + * @return the systemDatastoresAuthMode value. */ - public String mlFlowTrackingUri() { - return this.mlFlowTrackingUri; + public String systemDatastoresAuthMode() { + return this.systemDatastoresAuthMode; + } + + /** + * Set the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. + * + * @param systemDatastoresAuthMode the systemDatastoresAuthMode value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withSystemDatastoresAuthMode(String systemDatastoresAuthMode) { + this.systemDatastoresAuthMode = systemDatastoresAuthMode; + return this; + } + + /** + * Get the tenantId property: The tenant id associated with this workspace. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; } /** @@ -595,6 +882,35 @@ public WorkspacePropertiesInner withV1LegacyMode(Boolean v1LegacyMode) { return this; } + /** + * Get the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + public WorkspaceHubConfig workspaceHubConfig() { + return this.workspaceHubConfig; + } + + /** + * Set the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @param workspaceHubConfig the workspaceHubConfig value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + this.workspaceHubConfig = workspaceHubConfig; + return this; + } + + /** + * Get the workspaceId property: The immutable id associated with this workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + /** * Validates the instance. * @@ -604,17 +920,26 @@ public void validate() { if (encryption() != null) { encryption().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (featureStoreSettings() != null) { + featureStoreSettings().validate(); } - if (sharedPrivateLinkResources() != null) { - sharedPrivateLinkResources().forEach(e -> e.validate()); + if (managedNetwork() != null) { + managedNetwork().validate(); } if (notebookInfo() != null) { notebookInfo().validate(); } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } if (serviceManagedResourcesSettings() != null) { serviceManagedResourcesSettings().validate(); } + if (sharedPrivateLinkResources() != null) { + sharedPrivateLinkResources().forEach(e -> e.validate()); + } + if (workspaceHubConfig() != null) { + workspaceHubConfig().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java deleted file mode 100644 index ecf35a74ba330..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters for updating the properties of a machine learning workspace. */ -@Fluent -public final class WorkspacePropertiesUpdateParameters { - /* - * The description of this workspace. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The friendly name for this workspace. - */ - @JsonProperty(value = "friendlyName") - private String friendlyName; - - /* - * The compute name for image build - */ - @JsonProperty(value = "imageBuildCompute") - private String imageBuildCompute; - - /* - * The service managed resource settings. - */ - @JsonProperty(value = "serviceManagedResourcesSettings") - private ServiceManagedResourcesSettings serviceManagedResourcesSettings; - - /* - * The user assigned identity resource id that represents the workspace identity. - */ - @JsonProperty(value = "primaryUserAssignedIdentity") - private String primaryUserAssignedIdentity; - - /* - * Whether requests from Public Network are allowed. - */ - @JsonProperty(value = "publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; - - /* - * ARM id of the application insights associated with this workspace. - */ - @JsonProperty(value = "applicationInsights") - private String applicationInsights; - - /* - * ARM id of the container registry associated with this workspace. - */ - @JsonProperty(value = "containerRegistry") - private String containerRegistry; - - /** Creates an instance of WorkspacePropertiesUpdateParameters class. */ - public WorkspacePropertiesUpdateParameters() { - } - - /** - * Get the description property: The description of this workspace. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of this workspace. - * - * @param description the description value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the friendlyName property: The friendly name for this workspace. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: The friendly name for this workspace. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the imageBuildCompute property: The compute name for image build. - * - * @return the imageBuildCompute value. - */ - public String imageBuildCompute() { - return this.imageBuildCompute; - } - - /** - * Set the imageBuildCompute property: The compute name for image build. - * - * @param imageBuildCompute the imageBuildCompute value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withImageBuildCompute(String imageBuildCompute) { - this.imageBuildCompute = imageBuildCompute; - return this; - } - - /** - * Get the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @return the serviceManagedResourcesSettings value. - */ - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.serviceManagedResourcesSettings; - } - - /** - * Set the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { - this.serviceManagedResourcesSettings = serviceManagedResourcesSettings; - return this; - } - - /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @return the primaryUserAssignedIdentity value. - */ - public String primaryUserAssignedIdentity() { - return this.primaryUserAssignedIdentity; - } - - /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { - this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; - return this; - } - - /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @return the applicationInsights value. - */ - public String applicationInsights() { - return this.applicationInsights; - } - - /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @param applicationInsights the applicationInsights value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withApplicationInsights(String applicationInsights) { - this.applicationInsights = applicationInsights; - return this; - } - - /** - * Get the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @return the containerRegistry value. - */ - public String containerRegistry() { - return this.containerRegistry; - } - - /** - * Set the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @param containerRegistry the containerRegistry value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withContainerRegistry(String containerRegistry) { - this.containerRegistry = containerRegistry; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceManagedResourcesSettings() != null) { - serviceManagedResourcesSettings().validate(); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java new file mode 100644 index 0000000000000..b4f6d92a22545 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a machine learning workspace. */ +@Fluent +public final class WorkspacePropertiesUpdateParametersInner { + /* + * ARM id of the application insights associated with this workspace. + */ + @JsonProperty(value = "applicationInsights") + private String applicationInsights; + + /* + * ARM id of the container registry associated with this workspace. + */ + @JsonProperty(value = "containerRegistry") + private String containerRegistry; + + /* + * The description of this workspace. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The enableDataIsolation property. + */ + @JsonProperty(value = "enableDataIsolation") + private Boolean enableDataIsolation; + + /* + * The encryption property. + */ + @JsonProperty(value = "encryption") + private EncryptionUpdateProperties encryption; + + /* + * Settings for feature store type workspace. + */ + @JsonProperty(value = "featureStoreSettings") + private FeatureStoreSettings featureStoreSettings; + + /* + * The friendly name for this workspace. This name in mutable + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The compute name for image build + */ + @JsonProperty(value = "imageBuildCompute") + private String imageBuildCompute; + + /* + * Managed Network settings for a machine learning workspace. + */ + @JsonProperty(value = "managedNetwork") + private ManagedNetworkSettingsInner managedNetwork; + + /* + * The user assigned identity resource id that represents the workspace identity. + */ + @JsonProperty(value = "primaryUserAssignedIdentity") + private String primaryUserAssignedIdentity; + + /* + * Whether requests from Public Network are allowed. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccessType publicNetworkAccess; + + /* + * The service managed resource settings. + */ + @JsonProperty(value = "serviceManagedResourcesSettings") + private ServiceManagedResourcesSettings serviceManagedResourcesSettings; + + /* + * Retention time in days after workspace get soft deleted. + */ + @JsonProperty(value = "softDeleteRetentionInDays") + private Integer softDeleteRetentionInDays; + + /* + * Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + */ + @JsonProperty(value = "v1LegacyMode") + private Boolean v1LegacyMode; + + /** Creates an instance of WorkspacePropertiesUpdateParametersInner class. */ + public WorkspacePropertiesUpdateParametersInner() { + } + + /** + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + public String applicationInsights() { + return this.applicationInsights; + } + + /** + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @param applicationInsights the applicationInsights value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withApplicationInsights(String applicationInsights) { + this.applicationInsights = applicationInsights; + return this; + } + + /** + * Get the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + public String containerRegistry() { + return this.containerRegistry; + } + + /** + * Set the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @param containerRegistry the containerRegistry value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withContainerRegistry(String containerRegistry) { + this.containerRegistry = containerRegistry; + return this; + } + + /** + * Get the description property: The description of this workspace. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this workspace. + * + * @param description the description value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.enableDataIsolation; + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withEnableDataIsolation(Boolean enableDataIsolation) { + this.enableDataIsolation = enableDataIsolation; + return this; + } + + /** + * Get the encryption property: The encryption property. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption property. + * + * @param encryption the encryption value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withEncryption(EncryptionUpdateProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.featureStoreSettings; + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withFeatureStoreSettings( + FeatureStoreSettings featureStoreSettings) { + this.featureStoreSettings = featureStoreSettings; + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + public String imageBuildCompute() { + return this.imageBuildCompute; + } + + /** + * Set the imageBuildCompute property: The compute name for image build. + * + * @param imageBuildCompute the imageBuildCompute value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withImageBuildCompute(String imageBuildCompute) { + this.imageBuildCompute = imageBuildCompute; + return this; + } + + /** + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsInner managedNetwork() { + return this.managedNetwork; + } + + /** + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + this.managedNetwork = managedNetwork; + return this; + } + + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.primaryUserAssignedIdentity; + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withPrimaryUserAssignedIdentity( + String primaryUserAssignedIdentity) { + this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withPublicNetworkAccess( + PublicNetworkAccessType publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.serviceManagedResourcesSettings; + } + + /** + * Set the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withServiceManagedResourcesSettings( + ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + this.serviceManagedResourcesSettings = serviceManagedResourcesSettings; + return this; + } + + /** + * Get the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @return the softDeleteRetentionInDays value. + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + this.softDeleteRetentionInDays = softDeleteRetentionInDays; + return this; + } + + /** + * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + public Boolean v1LegacyMode() { + return this.v1LegacyMode; + } + + /** + * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @param v1LegacyMode the v1LegacyMode value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withV1LegacyMode(Boolean v1LegacyMode) { + this.v1LegacyMode = v1LegacyMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryption() != null) { + encryption().validate(); + } + if (featureStoreSettings() != null) { + featureStoreSettings().validate(); + } + if (managedNetwork() != null) { + managedNetwork().validate(); + } + if (serviceManagedResourcesSettings() != null) { + serviceManagedResourcesSettings().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java new file mode 100644 index 0000000000000..f43f6320e9add --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a machine learning workspace. */ +@Fluent +public final class WorkspaceUpdateParametersInner { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * The properties that the machine learning workspace will be updated with. + */ + @JsonProperty(value = "properties") + private WorkspacePropertiesUpdateParametersInner innerProperties; + + /* + * Optional. This field is required to be implemented by the RP because AML is supporting more than one tier + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The resource tags for the machine learning workspace. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of WorkspaceUpdateParametersInner class. */ + public WorkspaceUpdateParametersInner() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties that the machine learning workspace will be updated with. + * + * @return the innerProperties value. + */ + private WorkspacePropertiesUpdateParametersInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. + * + * @param sku the sku value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: The resource tags for the machine learning workspace. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags for the machine learning workspace. + * + * @param tags the tags value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + public String applicationInsights() { + return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); + } + + /** + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @param applicationInsights the applicationInsights value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withApplicationInsights(String applicationInsights) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withApplicationInsights(applicationInsights); + return this; + } + + /** + * Get the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + public String containerRegistry() { + return this.innerProperties() == null ? null : this.innerProperties().containerRegistry(); + } + + /** + * Set the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @param containerRegistry the containerRegistry value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withContainerRegistry(String containerRegistry) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withContainerRegistry(containerRegistry); + return this; + } + + /** + * Get the description property: The description of this workspace. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of this workspace. + * + * @param description the description value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.innerProperties() == null ? null : this.innerProperties().enableDataIsolation(); + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withEnableDataIsolation(Boolean enableDataIsolation) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withEnableDataIsolation(enableDataIsolation); + return this; + } + + /** + * Get the encryption property: The encryption property. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption property. + * + * @param encryption the encryption value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withEncryption(EncryptionUpdateProperties encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.innerProperties() == null ? null : this.innerProperties().featureStoreSettings(); + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withFeatureStoreSettings(featureStoreSettings); + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + public String imageBuildCompute() { + return this.innerProperties() == null ? null : this.innerProperties().imageBuildCompute(); + } + + /** + * Set the imageBuildCompute property: The compute name for image build. + * + * @param imageBuildCompute the imageBuildCompute value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withImageBuildCompute(String imageBuildCompute) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withImageBuildCompute(imageBuildCompute); + return this; + } + + /** + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsInner managedNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().managedNetwork(); + } + + /** + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withManagedNetwork(managedNetwork); + return this; + } + + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + return this; + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serviceManagedResourcesSettings(); + } + + /** + * Set the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withServiceManagedResourcesSettings( + ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); + return this; + } + + /** + * Get the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @return the softDeleteRetentionInDays value. + */ + public Integer softDeleteRetentionInDays() { + return this.innerProperties() == null ? null : this.innerProperties().softDeleteRetentionInDays(); + } + + /** + * Set the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withSoftDeleteRetentionInDays(softDeleteRetentionInDays); + return this; + } + + /** + * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + public Boolean v1LegacyMode() { + return this.innerProperties() == null ? null : this.innerProperties().v1LegacyMode(); + } + + /** + * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @param v1LegacyMode the v1LegacyMode value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withV1LegacyMode(Boolean v1LegacyMode) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withV1LegacyMode(v1LegacyMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java index 3e822d30cd968..c4a20504c94a0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for AzureMachineLearningWorkspaces. These APIs allow end users to operate on + * Package containing the inner data models for AzureMachineLearningServices. These APIs allow end users to operate on * Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.fluent.models; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java index f5bef46229750..50522669a1fc8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for AzureMachineLearningWorkspaces. These APIs allow end users to operate on + * Package containing the service clients for AzureMachineLearningServices. These APIs allow end users to operate on * Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.fluent; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java index 803be140a597c..b8bc5f1164dbe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java @@ -6,7 +6,7 @@ import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; import com.azure.resourcemanager.machinelearning.models.AmlOperation; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; +import com.azure.resourcemanager.machinelearning.models.OperationDisplay; public final class AmlOperationImpl implements AmlOperation { private AmlOperationInner innerObject; @@ -20,11 +20,7 @@ public final class AmlOperationImpl implements AmlOperation { this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); - } - - public AmlOperationDisplay display() { + public OperationDisplay display() { return this.innerModel().display(); } @@ -32,6 +28,14 @@ public Boolean isDataAction() { return this.innerModel().isDataAction(); } + public String name() { + return this.innerModel().name(); + } + + public String origin() { + return this.innerModel().origin(); + } + public AmlOperationInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java new file mode 100644 index 0000000000000..48795f9c5d6cf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AzureMachineLearningServicesImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureMachineLearningServicesImpl.class}) +public final class AzureMachineLearningServicesBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureMachineLearningServicesImpl with the provided parameters. + * + * @return an instance of AzureMachineLearningServicesImpl. + */ + public AzureMachineLearningServicesImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AzureMachineLearningServicesImpl client = + new AzureMachineLearningServicesImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java new file mode 100644 index 0000000000000..c90ac3eae39a2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java @@ -0,0 +1,920 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningServices; +import com.azure.resourcemanager.machinelearning.fluent.BatchDeploymentsClient; +import com.azure.resourcemanager.machinelearning.fluent.BatchEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.CodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.ComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; +import com.azure.resourcemanager.machinelearning.fluent.DataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.DataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.DatastoresClient; +import com.azure.resourcemanager.machinelearning.fluent.EnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.JobsClient; +import com.azure.resourcemanager.machinelearning.fluent.LabelingJobsClient; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.ModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.OnlineDeploymentsClient; +import com.azure.resourcemanager.machinelearning.fluent.OnlineEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; +import com.azure.resourcemanager.machinelearning.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.machinelearning.fluent.QuotasClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.SchedulesClient; +import com.azure.resourcemanager.machinelearning.fluent.UsagesClient; +import com.azure.resourcemanager.machinelearning.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspaceConnectionsClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspaceFeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspacesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AzureMachineLearningServicesImpl type. */ +@ServiceClient(builder = AzureMachineLearningServicesBuilder.class) +public final class AzureMachineLearningServicesImpl implements AzureMachineLearningServices { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The VirtualMachineSizesClient object to access its operations. */ + private final VirtualMachineSizesClient virtualMachineSizes; + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + public VirtualMachineSizesClient getVirtualMachineSizes() { + return this.virtualMachineSizes; + } + + /** The QuotasClient object to access its operations. */ + private final QuotasClient quotas; + + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + public QuotasClient getQuotas() { + return this.quotas; + } + + /** The ComputesClient object to access its operations. */ + private final ComputesClient computes; + + /** + * Gets the ComputesClient object to access its operations. + * + * @return the ComputesClient object. + */ + public ComputesClient getComputes() { + return this.computes; + } + + /** The RegistryCodeContainersClient object to access its operations. */ + private final RegistryCodeContainersClient registryCodeContainers; + + /** + * Gets the RegistryCodeContainersClient object to access its operations. + * + * @return the RegistryCodeContainersClient object. + */ + public RegistryCodeContainersClient getRegistryCodeContainers() { + return this.registryCodeContainers; + } + + /** The RegistryCodeVersionsClient object to access its operations. */ + private final RegistryCodeVersionsClient registryCodeVersions; + + /** + * Gets the RegistryCodeVersionsClient object to access its operations. + * + * @return the RegistryCodeVersionsClient object. + */ + public RegistryCodeVersionsClient getRegistryCodeVersions() { + return this.registryCodeVersions; + } + + /** The RegistryComponentContainersClient object to access its operations. */ + private final RegistryComponentContainersClient registryComponentContainers; + + /** + * Gets the RegistryComponentContainersClient object to access its operations. + * + * @return the RegistryComponentContainersClient object. + */ + public RegistryComponentContainersClient getRegistryComponentContainers() { + return this.registryComponentContainers; + } + + /** The RegistryComponentVersionsClient object to access its operations. */ + private final RegistryComponentVersionsClient registryComponentVersions; + + /** + * Gets the RegistryComponentVersionsClient object to access its operations. + * + * @return the RegistryComponentVersionsClient object. + */ + public RegistryComponentVersionsClient getRegistryComponentVersions() { + return this.registryComponentVersions; + } + + /** The RegistryDataContainersClient object to access its operations. */ + private final RegistryDataContainersClient registryDataContainers; + + /** + * Gets the RegistryDataContainersClient object to access its operations. + * + * @return the RegistryDataContainersClient object. + */ + public RegistryDataContainersClient getRegistryDataContainers() { + return this.registryDataContainers; + } + + /** The RegistryDataVersionsClient object to access its operations. */ + private final RegistryDataVersionsClient registryDataVersions; + + /** + * Gets the RegistryDataVersionsClient object to access its operations. + * + * @return the RegistryDataVersionsClient object. + */ + public RegistryDataVersionsClient getRegistryDataVersions() { + return this.registryDataVersions; + } + + /** The RegistryEnvironmentContainersClient object to access its operations. */ + private final RegistryEnvironmentContainersClient registryEnvironmentContainers; + + /** + * Gets the RegistryEnvironmentContainersClient object to access its operations. + * + * @return the RegistryEnvironmentContainersClient object. + */ + public RegistryEnvironmentContainersClient getRegistryEnvironmentContainers() { + return this.registryEnvironmentContainers; + } + + /** The RegistryEnvironmentVersionsClient object to access its operations. */ + private final RegistryEnvironmentVersionsClient registryEnvironmentVersions; + + /** + * Gets the RegistryEnvironmentVersionsClient object to access its operations. + * + * @return the RegistryEnvironmentVersionsClient object. + */ + public RegistryEnvironmentVersionsClient getRegistryEnvironmentVersions() { + return this.registryEnvironmentVersions; + } + + /** The RegistryModelContainersClient object to access its operations. */ + private final RegistryModelContainersClient registryModelContainers; + + /** + * Gets the RegistryModelContainersClient object to access its operations. + * + * @return the RegistryModelContainersClient object. + */ + public RegistryModelContainersClient getRegistryModelContainers() { + return this.registryModelContainers; + } + + /** The RegistryModelVersionsClient object to access its operations. */ + private final RegistryModelVersionsClient registryModelVersions; + + /** + * Gets the RegistryModelVersionsClient object to access its operations. + * + * @return the RegistryModelVersionsClient object. + */ + public RegistryModelVersionsClient getRegistryModelVersions() { + return this.registryModelVersions; + } + + /** The BatchEndpointsClient object to access its operations. */ + private final BatchEndpointsClient batchEndpoints; + + /** + * Gets the BatchEndpointsClient object to access its operations. + * + * @return the BatchEndpointsClient object. + */ + public BatchEndpointsClient getBatchEndpoints() { + return this.batchEndpoints; + } + + /** The BatchDeploymentsClient object to access its operations. */ + private final BatchDeploymentsClient batchDeployments; + + /** + * Gets the BatchDeploymentsClient object to access its operations. + * + * @return the BatchDeploymentsClient object. + */ + public BatchDeploymentsClient getBatchDeployments() { + return this.batchDeployments; + } + + /** The CodeContainersClient object to access its operations. */ + private final CodeContainersClient codeContainers; + + /** + * Gets the CodeContainersClient object to access its operations. + * + * @return the CodeContainersClient object. + */ + public CodeContainersClient getCodeContainers() { + return this.codeContainers; + } + + /** The CodeVersionsClient object to access its operations. */ + private final CodeVersionsClient codeVersions; + + /** + * Gets the CodeVersionsClient object to access its operations. + * + * @return the CodeVersionsClient object. + */ + public CodeVersionsClient getCodeVersions() { + return this.codeVersions; + } + + /** The ComponentContainersClient object to access its operations. */ + private final ComponentContainersClient componentContainers; + + /** + * Gets the ComponentContainersClient object to access its operations. + * + * @return the ComponentContainersClient object. + */ + public ComponentContainersClient getComponentContainers() { + return this.componentContainers; + } + + /** The ComponentVersionsClient object to access its operations. */ + private final ComponentVersionsClient componentVersions; + + /** + * Gets the ComponentVersionsClient object to access its operations. + * + * @return the ComponentVersionsClient object. + */ + public ComponentVersionsClient getComponentVersions() { + return this.componentVersions; + } + + /** The DataContainersClient object to access its operations. */ + private final DataContainersClient dataContainers; + + /** + * Gets the DataContainersClient object to access its operations. + * + * @return the DataContainersClient object. + */ + public DataContainersClient getDataContainers() { + return this.dataContainers; + } + + /** The DataVersionsClient object to access its operations. */ + private final DataVersionsClient dataVersions; + + /** + * Gets the DataVersionsClient object to access its operations. + * + * @return the DataVersionsClient object. + */ + public DataVersionsClient getDataVersions() { + return this.dataVersions; + } + + /** The DatastoresClient object to access its operations. */ + private final DatastoresClient datastores; + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + public DatastoresClient getDatastores() { + return this.datastores; + } + + /** The EnvironmentContainersClient object to access its operations. */ + private final EnvironmentContainersClient environmentContainers; + + /** + * Gets the EnvironmentContainersClient object to access its operations. + * + * @return the EnvironmentContainersClient object. + */ + public EnvironmentContainersClient getEnvironmentContainers() { + return this.environmentContainers; + } + + /** The EnvironmentVersionsClient object to access its operations. */ + private final EnvironmentVersionsClient environmentVersions; + + /** + * Gets the EnvironmentVersionsClient object to access its operations. + * + * @return the EnvironmentVersionsClient object. + */ + public EnvironmentVersionsClient getEnvironmentVersions() { + return this.environmentVersions; + } + + /** The FeaturesetContainersClient object to access its operations. */ + private final FeaturesetContainersClient featuresetContainers; + + /** + * Gets the FeaturesetContainersClient object to access its operations. + * + * @return the FeaturesetContainersClient object. + */ + public FeaturesetContainersClient getFeaturesetContainers() { + return this.featuresetContainers; + } + + /** The FeaturesClient object to access its operations. */ + private final FeaturesClient features; + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + public FeaturesClient getFeatures() { + return this.features; + } + + /** The FeaturesetVersionsClient object to access its operations. */ + private final FeaturesetVersionsClient featuresetVersions; + + /** + * Gets the FeaturesetVersionsClient object to access its operations. + * + * @return the FeaturesetVersionsClient object. + */ + public FeaturesetVersionsClient getFeaturesetVersions() { + return this.featuresetVersions; + } + + /** The FeaturestoreEntityContainersClient object to access its operations. */ + private final FeaturestoreEntityContainersClient featurestoreEntityContainers; + + /** + * Gets the FeaturestoreEntityContainersClient object to access its operations. + * + * @return the FeaturestoreEntityContainersClient object. + */ + public FeaturestoreEntityContainersClient getFeaturestoreEntityContainers() { + return this.featurestoreEntityContainers; + } + + /** The FeaturestoreEntityVersionsClient object to access its operations. */ + private final FeaturestoreEntityVersionsClient featurestoreEntityVersions; + + /** + * Gets the FeaturestoreEntityVersionsClient object to access its operations. + * + * @return the FeaturestoreEntityVersionsClient object. + */ + public FeaturestoreEntityVersionsClient getFeaturestoreEntityVersions() { + return this.featurestoreEntityVersions; + } + + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The LabelingJobsClient object to access its operations. */ + private final LabelingJobsClient labelingJobs; + + /** + * Gets the LabelingJobsClient object to access its operations. + * + * @return the LabelingJobsClient object. + */ + public LabelingJobsClient getLabelingJobs() { + return this.labelingJobs; + } + + /** The ModelContainersClient object to access its operations. */ + private final ModelContainersClient modelContainers; + + /** + * Gets the ModelContainersClient object to access its operations. + * + * @return the ModelContainersClient object. + */ + public ModelContainersClient getModelContainers() { + return this.modelContainers; + } + + /** The ModelVersionsClient object to access its operations. */ + private final ModelVersionsClient modelVersions; + + /** + * Gets the ModelVersionsClient object to access its operations. + * + * @return the ModelVersionsClient object. + */ + public ModelVersionsClient getModelVersions() { + return this.modelVersions; + } + + /** The OnlineEndpointsClient object to access its operations. */ + private final OnlineEndpointsClient onlineEndpoints; + + /** + * Gets the OnlineEndpointsClient object to access its operations. + * + * @return the OnlineEndpointsClient object. + */ + public OnlineEndpointsClient getOnlineEndpoints() { + return this.onlineEndpoints; + } + + /** The OnlineDeploymentsClient object to access its operations. */ + private final OnlineDeploymentsClient onlineDeployments; + + /** + * Gets the OnlineDeploymentsClient object to access its operations. + * + * @return the OnlineDeploymentsClient object. + */ + public OnlineDeploymentsClient getOnlineDeployments() { + return this.onlineDeployments; + } + + /** The SchedulesClient object to access its operations. */ + private final SchedulesClient schedules; + + /** + * Gets the SchedulesClient object to access its operations. + * + * @return the SchedulesClient object. + */ + public SchedulesClient getSchedules() { + return this.schedules; + } + + /** The RegistriesClient object to access its operations. */ + private final RegistriesClient registries; + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + public RegistriesClient getRegistries() { + return this.registries; + } + + /** The WorkspaceFeaturesClient object to access its operations. */ + private final WorkspaceFeaturesClient workspaceFeatures; + + /** + * Gets the WorkspaceFeaturesClient object to access its operations. + * + * @return the WorkspaceFeaturesClient object. + */ + public WorkspaceFeaturesClient getWorkspaceFeatures() { + return this.workspaceFeatures; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The WorkspacesClient object to access its operations. */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** The WorkspaceConnectionsClient object to access its operations. */ + private final WorkspaceConnectionsClient workspaceConnections; + + /** + * Gets the WorkspaceConnectionsClient object to access its operations. + * + * @return the WorkspaceConnectionsClient object. + */ + public WorkspaceConnectionsClient getWorkspaceConnections() { + return this.workspaceConnections; + } + + /** The ManagedNetworkSettingsRulesClient object to access its operations. */ + private final ManagedNetworkSettingsRulesClient managedNetworkSettingsRules; + + /** + * Gets the ManagedNetworkSettingsRulesClient object to access its operations. + * + * @return the ManagedNetworkSettingsRulesClient object. + */ + public ManagedNetworkSettingsRulesClient getManagedNetworkSettingsRules() { + return this.managedNetworkSettingsRules; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The ManagedNetworkProvisionsClient object to access its operations. */ + private final ManagedNetworkProvisionsClient managedNetworkProvisions; + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + public ManagedNetworkProvisionsClient getManagedNetworkProvisions() { + return this.managedNetworkProvisions; + } + + /** + * Initializes an instance of AzureMachineLearningServices client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + AzureMachineLearningServicesImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-08-01-preview"; + this.usages = new UsagesClientImpl(this); + this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); + this.quotas = new QuotasClientImpl(this); + this.computes = new ComputesClientImpl(this); + this.registryCodeContainers = new RegistryCodeContainersClientImpl(this); + this.registryCodeVersions = new RegistryCodeVersionsClientImpl(this); + this.registryComponentContainers = new RegistryComponentContainersClientImpl(this); + this.registryComponentVersions = new RegistryComponentVersionsClientImpl(this); + this.registryDataContainers = new RegistryDataContainersClientImpl(this); + this.registryDataVersions = new RegistryDataVersionsClientImpl(this); + this.registryEnvironmentContainers = new RegistryEnvironmentContainersClientImpl(this); + this.registryEnvironmentVersions = new RegistryEnvironmentVersionsClientImpl(this); + this.registryModelContainers = new RegistryModelContainersClientImpl(this); + this.registryModelVersions = new RegistryModelVersionsClientImpl(this); + this.batchEndpoints = new BatchEndpointsClientImpl(this); + this.batchDeployments = new BatchDeploymentsClientImpl(this); + this.codeContainers = new CodeContainersClientImpl(this); + this.codeVersions = new CodeVersionsClientImpl(this); + this.componentContainers = new ComponentContainersClientImpl(this); + this.componentVersions = new ComponentVersionsClientImpl(this); + this.dataContainers = new DataContainersClientImpl(this); + this.dataVersions = new DataVersionsClientImpl(this); + this.datastores = new DatastoresClientImpl(this); + this.environmentContainers = new EnvironmentContainersClientImpl(this); + this.environmentVersions = new EnvironmentVersionsClientImpl(this); + this.featuresetContainers = new FeaturesetContainersClientImpl(this); + this.features = new FeaturesClientImpl(this); + this.featuresetVersions = new FeaturesetVersionsClientImpl(this); + this.featurestoreEntityContainers = new FeaturestoreEntityContainersClientImpl(this); + this.featurestoreEntityVersions = new FeaturestoreEntityVersionsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.labelingJobs = new LabelingJobsClientImpl(this); + this.modelContainers = new ModelContainersClientImpl(this); + this.modelVersions = new ModelVersionsClientImpl(this); + this.onlineEndpoints = new OnlineEndpointsClientImpl(this); + this.onlineDeployments = new OnlineDeploymentsClientImpl(this); + this.schedules = new SchedulesClientImpl(this); + this.registries = new RegistriesClientImpl(this); + this.workspaceFeatures = new WorkspaceFeaturesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + this.workspaceConnections = new WorkspaceConnectionsClientImpl(this); + this.managedNetworkSettingsRules = new ManagedNetworkSettingsRulesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.managedNetworkProvisions = new ManagedNetworkProvisionsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureMachineLearningServicesImpl.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java deleted file mode 100644 index 018c1d288b6ac..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the AzureMachineLearningWorkspacesImpl type. */ -@ServiceClientBuilder(serviceClients = {AzureMachineLearningWorkspacesImpl.class}) -public final class AzureMachineLearningWorkspacesBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of AzureMachineLearningWorkspacesImpl with the provided parameters. - * - * @return an instance of AzureMachineLearningWorkspacesImpl. - */ - public AzureMachineLearningWorkspacesImpl buildClient() { - String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; - AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureMachineLearningWorkspacesImpl client = - new AzureMachineLearningWorkspacesImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); - return client; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java deleted file mode 100644 index 242efe7553fdd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java +++ /dev/null @@ -1,654 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningWorkspaces; -import com.azure.resourcemanager.machinelearning.fluent.BatchDeploymentsClient; -import com.azure.resourcemanager.machinelearning.fluent.BatchEndpointsClient; -import com.azure.resourcemanager.machinelearning.fluent.CodeContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.ComponentContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.ComponentVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; -import com.azure.resourcemanager.machinelearning.fluent.DataContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.DataVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.DatastoresClient; -import com.azure.resourcemanager.machinelearning.fluent.EnvironmentContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.JobsClient; -import com.azure.resourcemanager.machinelearning.fluent.ModelContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.OnlineDeploymentsClient; -import com.azure.resourcemanager.machinelearning.fluent.OnlineEndpointsClient; -import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; -import com.azure.resourcemanager.machinelearning.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.machinelearning.fluent.QuotasClient; -import com.azure.resourcemanager.machinelearning.fluent.SchedulesClient; -import com.azure.resourcemanager.machinelearning.fluent.UsagesClient; -import com.azure.resourcemanager.machinelearning.fluent.VirtualMachineSizesClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspaceConnectionsClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspaceFeaturesClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspacesClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the AzureMachineLearningWorkspacesImpl type. */ -@ServiceClient(builder = AzureMachineLearningWorkspacesBuilder.class) -public final class AzureMachineLearningWorkspacesImpl implements AzureMachineLearningWorkspaces { - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The WorkspacesClient object to access its operations. */ - private final WorkspacesClient workspaces; - - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - public WorkspacesClient getWorkspaces() { - return this.workspaces; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The VirtualMachineSizesClient object to access its operations. */ - private final VirtualMachineSizesClient virtualMachineSizes; - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - public VirtualMachineSizesClient getVirtualMachineSizes() { - return this.virtualMachineSizes; - } - - /** The QuotasClient object to access its operations. */ - private final QuotasClient quotas; - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - public QuotasClient getQuotas() { - return this.quotas; - } - - /** The ComputesClient object to access its operations. */ - private final ComputesClient computes; - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - public ComputesClient getComputes() { - return this.computes; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The WorkspaceConnectionsClient object to access its operations. */ - private final WorkspaceConnectionsClient workspaceConnections; - - /** - * Gets the WorkspaceConnectionsClient object to access its operations. - * - * @return the WorkspaceConnectionsClient object. - */ - public WorkspaceConnectionsClient getWorkspaceConnections() { - return this.workspaceConnections; - } - - /** The BatchEndpointsClient object to access its operations. */ - private final BatchEndpointsClient batchEndpoints; - - /** - * Gets the BatchEndpointsClient object to access its operations. - * - * @return the BatchEndpointsClient object. - */ - public BatchEndpointsClient getBatchEndpoints() { - return this.batchEndpoints; - } - - /** The BatchDeploymentsClient object to access its operations. */ - private final BatchDeploymentsClient batchDeployments; - - /** - * Gets the BatchDeploymentsClient object to access its operations. - * - * @return the BatchDeploymentsClient object. - */ - public BatchDeploymentsClient getBatchDeployments() { - return this.batchDeployments; - } - - /** The CodeContainersClient object to access its operations. */ - private final CodeContainersClient codeContainers; - - /** - * Gets the CodeContainersClient object to access its operations. - * - * @return the CodeContainersClient object. - */ - public CodeContainersClient getCodeContainers() { - return this.codeContainers; - } - - /** The CodeVersionsClient object to access its operations. */ - private final CodeVersionsClient codeVersions; - - /** - * Gets the CodeVersionsClient object to access its operations. - * - * @return the CodeVersionsClient object. - */ - public CodeVersionsClient getCodeVersions() { - return this.codeVersions; - } - - /** The ComponentContainersClient object to access its operations. */ - private final ComponentContainersClient componentContainers; - - /** - * Gets the ComponentContainersClient object to access its operations. - * - * @return the ComponentContainersClient object. - */ - public ComponentContainersClient getComponentContainers() { - return this.componentContainers; - } - - /** The ComponentVersionsClient object to access its operations. */ - private final ComponentVersionsClient componentVersions; - - /** - * Gets the ComponentVersionsClient object to access its operations. - * - * @return the ComponentVersionsClient object. - */ - public ComponentVersionsClient getComponentVersions() { - return this.componentVersions; - } - - /** The DataContainersClient object to access its operations. */ - private final DataContainersClient dataContainers; - - /** - * Gets the DataContainersClient object to access its operations. - * - * @return the DataContainersClient object. - */ - public DataContainersClient getDataContainers() { - return this.dataContainers; - } - - /** The DataVersionsClient object to access its operations. */ - private final DataVersionsClient dataVersions; - - /** - * Gets the DataVersionsClient object to access its operations. - * - * @return the DataVersionsClient object. - */ - public DataVersionsClient getDataVersions() { - return this.dataVersions; - } - - /** The DatastoresClient object to access its operations. */ - private final DatastoresClient datastores; - - /** - * Gets the DatastoresClient object to access its operations. - * - * @return the DatastoresClient object. - */ - public DatastoresClient getDatastores() { - return this.datastores; - } - - /** The EnvironmentContainersClient object to access its operations. */ - private final EnvironmentContainersClient environmentContainers; - - /** - * Gets the EnvironmentContainersClient object to access its operations. - * - * @return the EnvironmentContainersClient object. - */ - public EnvironmentContainersClient getEnvironmentContainers() { - return this.environmentContainers; - } - - /** The EnvironmentVersionsClient object to access its operations. */ - private final EnvironmentVersionsClient environmentVersions; - - /** - * Gets the EnvironmentVersionsClient object to access its operations. - * - * @return the EnvironmentVersionsClient object. - */ - public EnvironmentVersionsClient getEnvironmentVersions() { - return this.environmentVersions; - } - - /** The JobsClient object to access its operations. */ - private final JobsClient jobs; - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - public JobsClient getJobs() { - return this.jobs; - } - - /** The ModelContainersClient object to access its operations. */ - private final ModelContainersClient modelContainers; - - /** - * Gets the ModelContainersClient object to access its operations. - * - * @return the ModelContainersClient object. - */ - public ModelContainersClient getModelContainers() { - return this.modelContainers; - } - - /** The ModelVersionsClient object to access its operations. */ - private final ModelVersionsClient modelVersions; - - /** - * Gets the ModelVersionsClient object to access its operations. - * - * @return the ModelVersionsClient object. - */ - public ModelVersionsClient getModelVersions() { - return this.modelVersions; - } - - /** The OnlineEndpointsClient object to access its operations. */ - private final OnlineEndpointsClient onlineEndpoints; - - /** - * Gets the OnlineEndpointsClient object to access its operations. - * - * @return the OnlineEndpointsClient object. - */ - public OnlineEndpointsClient getOnlineEndpoints() { - return this.onlineEndpoints; - } - - /** The OnlineDeploymentsClient object to access its operations. */ - private final OnlineDeploymentsClient onlineDeployments; - - /** - * Gets the OnlineDeploymentsClient object to access its operations. - * - * @return the OnlineDeploymentsClient object. - */ - public OnlineDeploymentsClient getOnlineDeployments() { - return this.onlineDeployments; - } - - /** The SchedulesClient object to access its operations. */ - private final SchedulesClient schedules; - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - public SchedulesClient getSchedules() { - return this.schedules; - } - - /** The WorkspaceFeaturesClient object to access its operations. */ - private final WorkspaceFeaturesClient workspaceFeatures; - - /** - * Gets the WorkspaceFeaturesClient object to access its operations. - * - * @return the WorkspaceFeaturesClient object. - */ - public WorkspaceFeaturesClient getWorkspaceFeatures() { - return this.workspaceFeatures; - } - - /** - * Initializes an instance of AzureMachineLearningWorkspaces client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - AzureMachineLearningWorkspacesImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2022-10-01"; - this.operations = new OperationsClientImpl(this); - this.workspaces = new WorkspacesClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); - this.quotas = new QuotasClientImpl(this); - this.computes = new ComputesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.workspaceConnections = new WorkspaceConnectionsClientImpl(this); - this.batchEndpoints = new BatchEndpointsClientImpl(this); - this.batchDeployments = new BatchDeploymentsClientImpl(this); - this.codeContainers = new CodeContainersClientImpl(this); - this.codeVersions = new CodeVersionsClientImpl(this); - this.componentContainers = new ComponentContainersClientImpl(this); - this.componentVersions = new ComponentVersionsClientImpl(this); - this.dataContainers = new DataContainersClientImpl(this); - this.dataVersions = new DataVersionsClientImpl(this); - this.datastores = new DatastoresClientImpl(this); - this.environmentContainers = new EnvironmentContainersClientImpl(this); - this.environmentVersions = new EnvironmentVersionsClientImpl(this); - this.jobs = new JobsClientImpl(this); - this.modelContainers = new ModelContainersClientImpl(this); - this.modelVersions = new ModelVersionsClientImpl(this); - this.onlineEndpoints = new OnlineEndpointsClientImpl(this); - this.onlineDeployments = new OnlineDeploymentsClientImpl(this); - this.schedules = new SchedulesClientImpl(this); - this.workspaceFeatures = new WorkspaceFeaturesClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AzureMachineLearningWorkspacesImpl.class); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java index 6f28d675f5f5a..ce019da00bf54 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java @@ -46,31 +46,29 @@ public final class BatchDeploymentsClientImpl implements BatchDeploymentsClient private final BatchDeploymentsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of BatchDeploymentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BatchDeploymentsClientImpl(AzureMachineLearningWorkspacesImpl client) { + BatchDeploymentsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(BatchDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesBatchDeployments to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesBatchDeployments to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface BatchDeploymentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -88,9 +86,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -106,9 +102,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -124,9 +118,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -143,9 +135,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java index 9d00fdc12171a..a26aec5b8be69 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java @@ -48,21 +48,21 @@ public final class BatchEndpointsClientImpl implements BatchEndpointsClient { private final BatchEndpointsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of BatchEndpointsClientImpl. * * @param client the instance of the service client containing this operation class. */ - BatchEndpointsClientImpl(AzureMachineLearningWorkspacesImpl client) { + BatchEndpointsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(BatchEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesBatchEndpoints to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesBatchEndpoints to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -70,8 +70,7 @@ public final class BatchEndpointsClientImpl implements BatchEndpointsClient { public interface BatchEndpointsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -87,8 +86,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -103,8 +101,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -119,8 +116,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -136,8 +132,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -153,9 +148,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/listkeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java index f739c63622acd..eae9e1a14652c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java @@ -49,13 +49,13 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String codeName; - public CodeContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public CodeContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } @@ -63,9 +63,8 @@ public CodeContainer create() { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), Context.NONE); return this; } @@ -73,16 +72,15 @@ public CodeContainer create(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), context); return this; } CodeContainerImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new CodeContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.codeName = name; } public CodeContainerImpl update() { @@ -93,9 +91,8 @@ public CodeContainer apply() { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), Context.NONE); return this; } @@ -103,9 +100,8 @@ public CodeContainer apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), context); return this; } @@ -115,16 +111,16 @@ public CodeContainer apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "codes"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.codeName = Utils.getValueFromIdByName(innerObject.id(), "codes"); } public CodeContainer refresh() { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getRegistryCodeContainers() + .getWithResponse(resourceGroupName, registryName, codeName, Context.NONE) .getValue(); return this; } @@ -133,8 +129,8 @@ public CodeContainer refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) + .getRegistryCodeContainers() + .getWithResponse(resourceGroupName, registryName, codeName, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java index 019f7490ddf83..22a21bcd33831 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java @@ -39,21 +39,21 @@ public final class CodeContainersClientImpl implements CodeContainersClient { private final CodeContainersService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of CodeContainersClientImpl. * * @param client the instance of the service client containing this operation class. */ - CodeContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { + CodeContainersClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(CodeContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesCodeContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesCodeContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -61,8 +61,7 @@ public final class CodeContainersClientImpl implements CodeContainersClient { public interface CodeContainersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -77,8 +76,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -93,8 +91,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -109,8 +106,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java index 0202b27fb32c4..c82929e2dc868 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java @@ -73,108 +73,29 @@ public CodeContainer get(String resourceGroupName, String workspaceName, String } } - public CodeContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, CodeContainerInner body, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CodeContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + public CodeContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, CodeContainerInner body) { + CodeContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new CodeContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private CodeContainersClient serviceClient() { @@ -184,8 +105,4 @@ private CodeContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public CodeContainerImpl define(String name) { - return new CodeContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java index daab7505f3ff6..20ee2762624c3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java @@ -4,11 +4,14 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersion; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class CodeVersionImpl implements CodeVersion, CodeVersion.Definition, CodeVersion.Update { private CodeVersionInner innerObject; @@ -49,16 +52,16 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String codeName; private String version; - public CodeVersionImpl withExistingCode(String resourceGroupName, String workspaceName, String name) { + public CodeVersionImpl withExistingCode(String resourceGroupName, String registryName, String codeName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.codeName = codeName; return this; } @@ -66,10 +69,8 @@ public CodeVersion create() { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), Context.NONE); return this; } @@ -77,9 +78,8 @@ public CodeVersion create(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), context); return this; } @@ -97,10 +97,8 @@ public CodeVersion apply() { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), Context.NONE); return this; } @@ -108,9 +106,8 @@ public CodeVersion apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), context); return this; } @@ -119,8 +116,8 @@ public CodeVersion apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "codes"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.codeName = Utils.getValueFromIdByName(innerObject.id(), "codes"); this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); } @@ -128,8 +125,8 @@ public CodeVersion refresh() { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getRegistryCodeVersions() + .getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE) .getValue(); return this; } @@ -138,12 +135,26 @@ public CodeVersion refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getCodeVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getRegistryCodeVersions() + .getWithResponse(resourceGroupName, registryName, codeName, version, context) .getValue(); return this; } + public Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context) { + return serviceManager + .registryCodeVersions() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, codeName, version, body, context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager + .registryCodeVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, codeName, version, body); + } + public CodeVersionImpl withProperties(CodeVersionProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java index 5e0cdc080acdd..08e0998d3ad9f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -30,7 +31,9 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in CodeVersionsClient. */ @@ -39,21 +42,21 @@ public final class CodeVersionsClientImpl implements CodeVersionsClient { private final CodeVersionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of CodeVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CodeVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + CodeVersionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(CodeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesCodeVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesCodeVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -61,8 +64,7 @@ public final class CodeVersionsClientImpl implements CodeVersionsClient { public interface CodeVersionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -75,13 +77,14 @@ Mono> list( @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("hash") String hash, + @QueryParam("hashVersion") String hashVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -97,8 +100,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -114,8 +116,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -130,6 +131,23 @@ Mono> createOrUpdate( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -150,6 +168,8 @@ Mono> listNext( * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -158,7 +178,14 @@ Mono> listNext( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String name, String orderBy, Integer top, String skip) { + String resourceGroupName, + String workspaceName, + String name, + String orderBy, + Integer top, + String skip, + String hash, + String hashVersion) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -196,6 +223,8 @@ private Mono> listSinglePageAsync( orderBy, top, skip, + hash, + hashVersion, accept, context)) .>map( @@ -219,6 +248,8 @@ private Mono> listSinglePageAsync( * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -234,6 +265,8 @@ private Mono> listSinglePageAsync( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -270,6 +303,8 @@ private Mono> listSinglePageAsync( orderBy, top, skip, + hash, + hashVersion, accept, context) .map( @@ -292,6 +327,8 @@ private Mono> listSinglePageAsync( * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -299,9 +336,16 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String name, String orderBy, Integer top, String skip) { + String resourceGroupName, + String workspaceName, + String name, + String orderBy, + Integer top, + String skip, + String hash, + String hashVersion) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -321,8 +365,10 @@ private PagedFlux listAsync(String resourceGroupName, String w final String orderBy = null; final Integer top = null; final String skip = null; + final String hash = null; + final String hashVersion = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -335,6 +381,8 @@ private PagedFlux listAsync(String resourceGroupName, String w * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -349,9 +397,13 @@ private PagedFlux listAsync( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, context), + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -371,7 +423,10 @@ public PagedIterable list(String resourceGroupName, String wor final String orderBy = null; final Integer top = null; final String skip = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip)); + final String hash = null; + final String hashVersion = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion)); } /** @@ -383,6 +438,8 @@ public PagedIterable list(String resourceGroupName, String wor * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -397,8 +454,11 @@ public PagedIterable list( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, context)); + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion, context)); } /** @@ -937,6 +997,207 @@ public CodeVersionInner createOrUpdate( .getValue(); } + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, workspaceName, name, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + return createOrGetStartPendingUploadWithResponseAsync( + resourceGroupName, workspaceName, name, version, body, context) + .block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse( + resourceGroupName, workspaceName, name, version, body, Context.NONE) + .getValue(); + } + /** * Get the next page of items. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java index 49705d0a8abd7..d3c542c6e065c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java @@ -11,8 +11,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; import com.azure.resourcemanager.machinelearning.models.CodeVersion; import com.azure.resourcemanager.machinelearning.models.CodeVersions; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class CodeVersionsImpl implements CodeVersions { private static final ClientLogger LOGGER = new ClientLogger(CodeVersionsImpl.class); @@ -40,9 +43,13 @@ public PagedIterable list( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, name, orderBy, top, skip, context); + this + .serviceClient() + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion, context); return Utils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); } @@ -79,136 +86,71 @@ public CodeVersion get(String resourceGroupName, String workspaceName, String na } } - public CodeVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + CodeVersionInner body, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CodeVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public CodeVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body) { + CodeVersionInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new CodeVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + Response inner = + this + .serviceClient() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = + this.serviceClient().createOrGetStartPendingUpload(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private CodeVersionsClient serviceClient() { @@ -218,8 +160,4 @@ private CodeVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public CodeVersionImpl define(String name) { - return new CodeVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java index 0208215c0403c..98f219f5889ea 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java @@ -50,13 +50,13 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String componentName; - public ComponentContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public ComponentContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } @@ -64,9 +64,8 @@ public ComponentContainer create() { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), Context.NONE); return this; } @@ -74,9 +73,8 @@ public ComponentContainer create(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), context); return this; } @@ -84,7 +82,7 @@ public ComponentContainer create(Context context) { String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new ComponentContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.componentName = name; } public ComponentContainerImpl update() { @@ -95,9 +93,8 @@ public ComponentContainer apply() { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), Context.NONE); return this; } @@ -105,9 +102,8 @@ public ComponentContainer apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), context); return this; } @@ -117,16 +113,16 @@ public ComponentContainer apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "components"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.componentName = Utils.getValueFromIdByName(innerObject.id(), "components"); } public ComponentContainer refresh() { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getRegistryComponentContainers() + .getWithResponse(resourceGroupName, registryName, componentName, Context.NONE) .getValue(); return this; } @@ -135,8 +131,8 @@ public ComponentContainer refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) + .getRegistryComponentContainers() + .getWithResponse(resourceGroupName, registryName, componentName, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java index 7c8593db5a972..85ef9aed402ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java @@ -40,21 +40,21 @@ public final class ComponentContainersClientImpl implements ComponentContainersC private final ComponentContainersService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComponentContainersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ComponentContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { + ComponentContainersClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ComponentContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComponentContainers to be used by the + * The interface defining all the services for AzureMachineLearningServicesComponentContainers to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @@ -62,8 +62,7 @@ public final class ComponentContainersClientImpl implements ComponentContainersC public interface ComponentContainersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -79,8 +78,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -95,8 +93,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -111,8 +108,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java index b9bc5f40a732d..308ac7fc8c0b8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java @@ -74,108 +74,30 @@ public ComponentContainer get(String resourceGroupName, String workspaceName, St } } - public ComponentContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, ComponentContainerInner body, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + public ComponentContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, ComponentContainerInner body) { + ComponentContainerInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new ComponentContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private ComponentContainersClient serviceClient() { @@ -185,8 +107,4 @@ private ComponentContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ComponentContainerImpl define(String name) { - return new ComponentContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java index 2b90ee811ddbd..8cda2a3d7a029 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java @@ -50,16 +50,17 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String componentName; private String version; - public ComponentVersionImpl withExistingComponent(String resourceGroupName, String workspaceName, String name) { + public ComponentVersionImpl withExistingComponent( + String resourceGroupName, String registryName, String componentName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.componentName = componentName; return this; } @@ -67,10 +68,9 @@ public ComponentVersion create() { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryComponentVersions() + .createOrUpdate( + resourceGroupName, registryName, componentName, version, this.innerModel(), Context.NONE); return this; } @@ -78,9 +78,8 @@ public ComponentVersion create(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), context); return this; } @@ -98,10 +97,9 @@ public ComponentVersion apply() { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryComponentVersions() + .createOrUpdate( + resourceGroupName, registryName, componentName, version, this.innerModel(), Context.NONE); return this; } @@ -109,9 +107,8 @@ public ComponentVersion apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), context); return this; } @@ -121,8 +118,8 @@ public ComponentVersion apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "components"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.componentName = Utils.getValueFromIdByName(innerObject.id(), "components"); this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); } @@ -130,8 +127,8 @@ public ComponentVersion refresh() { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getRegistryComponentVersions() + .getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE) .getValue(); return this; } @@ -140,8 +137,8 @@ public ComponentVersion refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getComponentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getRegistryComponentVersions() + .getWithResponse(resourceGroupName, registryName, componentName, version, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java index 4cfb98d8af644..111b793258fcf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java @@ -40,30 +40,29 @@ public final class ComponentVersionsClientImpl implements ComponentVersionsClien private final ComponentVersionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComponentVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ComponentVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + ComponentVersionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ComponentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComponentVersions to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesComponentVersions to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ComponentVersionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -77,13 +76,13 @@ Mono> list( @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -99,8 +98,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -116,8 +114,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -153,6 +150,7 @@ Mono> listNext( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -167,7 +165,8 @@ private Mono> listSinglePageAsync( String orderBy, Integer top, String skip, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -206,6 +205,7 @@ private Mono> listSinglePageAsync( top, skip, listViewType, + stage, accept, context)) .>map( @@ -230,6 +230,7 @@ private Mono> listSinglePageAsync( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -246,6 +247,7 @@ private Mono> listSinglePageAsync( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -283,6 +285,7 @@ private Mono> listSinglePageAsync( top, skip, listViewType, + stage, accept, context) .map( @@ -306,6 +309,7 @@ private Mono> listSinglePageAsync( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -319,9 +323,10 @@ private PagedFlux listAsync( String orderBy, Integer top, String skip, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -342,8 +347,9 @@ private PagedFlux listAsync(String resourceGroupName, Str final Integer top = null; final String skip = null; final ListViewType listViewType = null; + final String stage = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -357,6 +363,7 @@ private PagedFlux listAsync(String resourceGroupName, Str * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -372,10 +379,12 @@ private PagedFlux listAsync( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { return new PagedFlux<>( () -> - listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context), + listSinglePageAsync( + resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -396,7 +405,9 @@ public PagedIterable list(String resourceGroupName, Strin final Integer top = null; final String skip = null; final ListViewType listViewType = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType)); + final String stage = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage)); } /** @@ -409,6 +420,7 @@ public PagedIterable list(String resourceGroupName, Strin * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -424,9 +436,10 @@ public PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context)); + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context)); } /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java index b31d3e83102bb..73fd47d064d05 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java @@ -42,11 +42,12 @@ public PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { PagedIterable inner = this .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context); return Utils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); } @@ -83,136 +84,37 @@ public ComponentVersion get(String resourceGroupName, String workspaceName, Stri } } - public ComponentVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + ComponentVersionInner body, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public ComponentVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body) { + ComponentVersionInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new ComponentVersionImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private ComponentVersionsClient serviceClient() { @@ -222,8 +124,4 @@ private ComponentVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ComponentVersionImpl define(String name) { - return new ComponentVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java index 26ad7807900da..9d0ccb3d4a1d3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java @@ -15,10 +15,14 @@ import com.azure.resourcemanager.machinelearning.models.Compute; import com.azure.resourcemanager.machinelearning.models.ComputeResource; import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; import com.azure.resourcemanager.machinelearning.models.Sku; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ComputeResourceImpl implements ComputeResource, ComputeResource.Definition, ComputeResource.Update { @@ -178,6 +182,16 @@ public ComputeResource refresh(Context context) { return this; } + public Response updateCustomServicesWithResponse(List customServices, Context context) { + return serviceManager + .computes() + .updateCustomServicesWithResponse(resourceGroupName, workspaceName, computeName, customServices, context); + } + + public void updateCustomServices(List customServices) { + serviceManager.computes().updateCustomServices(resourceGroupName, workspaceName, computeName, customServices); + } + public PagedIterable listNodes() { return serviceManager.computes().listNodes(resourceGroupName, workspaceName, computeName); } @@ -218,6 +232,24 @@ public void restart(Context context) { serviceManager.computes().restart(resourceGroupName, workspaceName, computeName, context); } + public Response updateIdleShutdownSettingWithResponse(IdleShutdownSetting parameters, Context context) { + return serviceManager + .computes() + .updateIdleShutdownSettingWithResponse(resourceGroupName, workspaceName, computeName, parameters, context); + } + + public void updateIdleShutdownSetting(IdleShutdownSetting parameters) { + serviceManager.computes().updateIdleShutdownSetting(resourceGroupName, workspaceName, computeName, parameters); + } + + public void resize(ResizeSchema parameters) { + serviceManager.computes().resize(resourceGroupName, workspaceName, computeName, parameters); + } + + public void resize(ResizeSchema parameters, Context context) { + serviceManager.computes().resize(resourceGroupName, workspaceName, computeName, parameters, context); + } + public ComputeResourceImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java index 1502a033768b6..67735227dede5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java @@ -36,12 +36,17 @@ import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; import com.azure.resourcemanager.machinelearning.models.AmlComputeNodesInformation; import com.azure.resourcemanager.machinelearning.models.ClusterUpdateParameters; +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; import com.azure.resourcemanager.machinelearning.models.PaginatedComputeResourcesList; +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; import java.nio.ByteBuffer; +import java.util.List; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -51,29 +56,28 @@ public final class ComputesClientImpl implements ComputesClient { private final ComputesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComputesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ComputesClientImpl(AzureMachineLearningWorkspacesImpl client) { + ComputesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ComputesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComputes to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesComputes to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ComputesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -88,8 +92,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -104,8 +107,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -121,8 +123,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -138,8 +139,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -155,8 +155,23 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateCustomServices( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") List customServices, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNodes( @@ -171,8 +186,7 @@ Mono> listNodes( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @@ -187,8 +201,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> start( @@ -203,8 +216,7 @@ Mono>> start( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> stop( @@ -219,8 +231,7 @@ Mono>> stop( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restart( @@ -233,6 +244,53 @@ Mono>> restart( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateIdleShutdownSetting( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") IdleShutdownSetting parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/allowedVmSizesForResize") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> allowedResizeSizes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resize( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResizeSchema parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -1591,6 +1649,189 @@ public void delete( deleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context).block(); } + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateCustomServicesWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName, List customServices) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (customServices == null) { + return Mono.error(new IllegalArgumentException("Parameter customServices is required and cannot be null.")); + } else { + customServices.forEach(e -> e.validate()); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateCustomServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + customServices, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateCustomServicesWithResponseAsync( + String resourceGroupName, + String workspaceName, + String computeName, + List customServices, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (customServices == null) { + return Mono.error(new IllegalArgumentException("Parameter customServices is required and cannot be null.")); + } else { + customServices.forEach(e -> e.validate()); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateCustomServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + customServices, + accept, + context); + } + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateCustomServicesAsync( + String resourceGroupName, String workspaceName, String computeName, List customServices) { + return updateCustomServicesWithResponseAsync(resourceGroupName, workspaceName, computeName, customServices) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateCustomServicesWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + List customServices, + Context context) { + return updateCustomServicesWithResponseAsync( + resourceGroupName, workspaceName, computeName, customServices, context) + .block(); + } + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateCustomServices( + String resourceGroupName, String workspaceName, String computeName, List customServices) { + updateCustomServicesWithResponse(resourceGroupName, workspaceName, computeName, customServices, Context.NONE); + } + /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. * @@ -2707,6 +2948,627 @@ public void restart(String resourceGroupName, String workspaceName, String compu restartAsync(resourceGroupName, workspaceName, computeName, context).block(); } + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateIdleShutdownSettingWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateIdleShutdownSetting( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateIdleShutdownSettingWithResponseAsync( + String resourceGroupName, + String workspaceName, + String computeName, + IdleShutdownSetting parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateIdleShutdownSetting( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateIdleShutdownSettingAsync( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters) { + return updateIdleShutdownSettingWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateIdleShutdownSettingWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + IdleShutdownSetting parameters, + Context context) { + return updateIdleShutdownSettingWithResponseAsync( + resourceGroupName, workspaceName, computeName, parameters, context) + .block(); + } + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateIdleShutdownSetting( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters) { + updateIdleShutdownSettingWithResponse(resourceGroupName, workspaceName, computeName, parameters, Context.NONE); + } + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> allowedResizeSizesWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .allowedResizeSizes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> allowedResizeSizesWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .allowedResizeSizes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono allowedResizeSizesAsync( + String resourceGroupName, String workspaceName, String computeName) { + return allowedResizeSizesWithResponseAsync(resourceGroupName, workspaceName, computeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response allowedResizeSizesWithResponse( + String resourceGroupName, String workspaceName, String computeName, Context context) { + return allowedResizeSizesWithResponseAsync(resourceGroupName, workspaceName, computeName, context).block(); + } + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineSizeListResultInner allowedResizeSizes( + String resourceGroupName, String workspaceName, String computeName) { + return allowedResizeSizesWithResponse(resourceGroupName, workspaceName, computeName, Context.NONE).getValue(); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resize( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (computeName == null) { + return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resize( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + computeName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResizeAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResizeAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + return this.beginResizeAsync(resourceGroupName, workspaceName, computeName, parameters).getSyncPoller(); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + return this + .beginResizeAsync(resourceGroupName, workspaceName, computeName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + return beginResizeAsync(resourceGroupName, workspaceName, computeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + return beginResizeAsync(resourceGroupName, workspaceName, computeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resize(String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + resizeAsync(resourceGroupName, workspaceName, computeName, parameters).block(); + } + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + resizeAsync(resourceGroupName, workspaceName, computeName, parameters, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java index 9b3cc25f7885b..c04446a102f97 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java @@ -12,11 +12,17 @@ import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; import com.azure.resourcemanager.machinelearning.models.ComputeResource; import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; import com.azure.resourcemanager.machinelearning.models.Computes; +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; +import com.azure.resourcemanager.machinelearning.models.VirtualMachineSizeListResult; +import java.util.List; public final class ComputesImpl implements Computes { private static final ClientLogger LOGGER = new ClientLogger(ComputesImpl.class); @@ -84,6 +90,22 @@ public void delete( this.serviceClient().delete(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context); } + public Response updateCustomServicesWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + List customServices, + Context context) { + return this + .serviceClient() + .updateCustomServicesWithResponse(resourceGroupName, workspaceName, computeName, customServices, context); + } + + public void updateCustomServices( + String resourceGroupName, String workspaceName, String computeName, List customServices) { + this.serviceClient().updateCustomServices(resourceGroupName, workspaceName, computeName, customServices); + } + public PagedIterable listNodes( String resourceGroupName, String workspaceName, String computeName) { return this.serviceClient().listNodes(resourceGroupName, workspaceName, computeName); @@ -142,6 +164,57 @@ public void restart(String resourceGroupName, String workspaceName, String compu this.serviceClient().restart(resourceGroupName, workspaceName, computeName, context); } + public Response updateIdleShutdownSettingWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + IdleShutdownSetting parameters, + Context context) { + return this + .serviceClient() + .updateIdleShutdownSettingWithResponse(resourceGroupName, workspaceName, computeName, parameters, context); + } + + public void updateIdleShutdownSetting( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters) { + this.serviceClient().updateIdleShutdownSetting(resourceGroupName, workspaceName, computeName, parameters); + } + + public Response allowedResizeSizesWithResponse( + String resourceGroupName, String workspaceName, String computeName, Context context) { + Response inner = + this.serviceClient().allowedResizeSizesWithResponse(resourceGroupName, workspaceName, computeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineSizeListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineSizeListResult allowedResizeSizes( + String resourceGroupName, String workspaceName, String computeName) { + VirtualMachineSizeListResultInner inner = + this.serviceClient().allowedResizeSizes(resourceGroupName, workspaceName, computeName); + if (inner != null) { + return new VirtualMachineSizeListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void resize(String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters) { + this.serviceClient().resize(resourceGroupName, workspaceName, computeName, parameters); + } + + public void resize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context) { + this.serviceClient().resize(resourceGroupName, workspaceName, computeName, parameters, context); + } + public ComputeResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java index 226bd04ddbb2d..27f16726e21f2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java @@ -49,13 +49,13 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; private String name; - public DataContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public DataContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } @@ -63,9 +63,8 @@ public DataContainer create() { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), Context.NONE); return this; } @@ -73,9 +72,8 @@ public DataContainer create(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), context); return this; } @@ -93,9 +91,8 @@ public DataContainer apply() { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), Context.NONE); return this; } @@ -103,9 +100,8 @@ public DataContainer apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), context); return this; } @@ -115,7 +111,7 @@ public DataContainer apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); this.name = Utils.getValueFromIdByName(innerObject.id(), "data"); } @@ -123,8 +119,8 @@ public DataContainer refresh() { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getRegistryDataContainers() + .getWithResponse(resourceGroupName, registryName, name, Context.NONE) .getValue(); return this; } @@ -133,8 +129,8 @@ public DataContainer refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) + .getRegistryDataContainers() + .getWithResponse(resourceGroupName, registryName, name, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java index ce1b750a11dec..1760b3a4d12c9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java @@ -40,21 +40,21 @@ public final class DataContainersClientImpl implements DataContainersClient { private final DataContainersService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DataContainersClientImpl. * * @param client the instance of the service client containing this operation class. */ - DataContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { + DataContainersClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(DataContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDataContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDataContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -62,8 +62,7 @@ public final class DataContainersClientImpl implements DataContainersClient { public interface DataContainersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -79,8 +78,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -95,8 +93,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -111,8 +108,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java index 2bc8ef7ece530..ec7dad9c79b8e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java @@ -74,108 +74,29 @@ public DataContainer get(String resourceGroupName, String workspaceName, String } } - public DataContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, DataContainerInner body, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + public DataContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, DataContainerInner body) { + DataContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new DataContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private DataContainersClient serviceClient() { @@ -185,8 +106,4 @@ private DataContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public DataContainerImpl define(String name) { - return new DataContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java index 00c2cd10b3754..19d81afbc327c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java @@ -4,11 +4,14 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.DataVersionBase; import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class DataVersionBaseImpl implements DataVersionBase, DataVersionBase.Definition, DataVersionBase.Update { private DataVersionBaseInner innerObject; @@ -49,15 +52,15 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; private String name; private String version; - public DataVersionBaseImpl withExistingData(String resourceGroupName, String workspaceName, String name) { + public DataVersionBaseImpl withExistingData(String resourceGroupName, String registryName, String name) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; this.name = name; return this; } @@ -66,10 +69,8 @@ public DataVersionBase create() { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), Context.NONE); return this; } @@ -77,9 +78,8 @@ public DataVersionBase create(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), context); return this; } @@ -97,10 +97,8 @@ public DataVersionBase apply() { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), Context.NONE); return this; } @@ -108,9 +106,8 @@ public DataVersionBase apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), context); return this; } @@ -120,7 +117,7 @@ public DataVersionBase apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); this.name = Utils.getValueFromIdByName(innerObject.id(), "data"); this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); } @@ -129,8 +126,8 @@ public DataVersionBase refresh() { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getRegistryDataVersions() + .getWithResponse(resourceGroupName, registryName, name, version, Context.NONE) .getValue(); return this; } @@ -139,12 +136,25 @@ public DataVersionBase refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getDataVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getRegistryDataVersions() + .getWithResponse(resourceGroupName, registryName, name, version, context) .getValue(); return this; } + public Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context) { + return serviceManager + .registryDataVersions() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, name, version, body, context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager + .registryDataVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, name, version, body); + } + public DataVersionBaseImpl withProperties(DataVersionBaseProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java index 3a6cbe8f79548..baaf69f4dbb19 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java @@ -40,21 +40,21 @@ public final class DataVersionsClientImpl implements DataVersionsClient { private final DataVersionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DataVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DataVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + DataVersionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(DataVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDataVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDataVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -62,8 +62,7 @@ public final class DataVersionsClientImpl implements DataVersionsClient { public interface DataVersionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -78,13 +77,13 @@ Mono> list( @QueryParam("$skip") String skip, @QueryParam("$tags") String tags, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -100,8 +99,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -117,8 +115,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -157,6 +154,7 @@ Mono> listNext( * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -172,7 +170,8 @@ private Mono> listSinglePageAsync( Integer top, String skip, String tags, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -212,6 +211,7 @@ private Mono> listSinglePageAsync( skip, tags, listViewType, + stage, accept, context)) .>map( @@ -239,6 +239,7 @@ private Mono> listSinglePageAsync( * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -256,6 +257,7 @@ private Mono> listSinglePageAsync( String skip, String tags, ListViewType listViewType, + String stage, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -294,6 +296,7 @@ private Mono> listSinglePageAsync( skip, tags, listViewType, + stage, accept, context) .map( @@ -320,6 +323,7 @@ private Mono> listSinglePageAsync( * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -334,9 +338,12 @@ private PagedFlux listAsync( Integer top, String skip, String tags, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType), + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -358,8 +365,11 @@ private PagedFlux listAsync(String resourceGroupName, Stri final String skip = null; final String tags = null; final ListViewType listViewType = null; + final String stage = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType), + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -376,6 +386,7 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -392,11 +403,12 @@ private PagedFlux listAsync( String skip, String tags, ListViewType listViewType, + String stage, Context context) { return new PagedFlux<>( () -> listSinglePageAsync( - resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context), + resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -418,8 +430,9 @@ public PagedIterable list(String resourceGroupName, String final String skip = null; final String tags = null; final ListViewType listViewType = null; + final String stage = null; return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType)); + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage)); } /** @@ -435,6 +448,7 @@ public PagedIterable list(String resourceGroupName, String * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -451,9 +465,10 @@ public PagedIterable list( String skip, String tags, ListViewType listViewType, + String stage, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context)); + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage, context)); } /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java index 09fc917310d6b..224e740589ada 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java @@ -43,11 +43,12 @@ public PagedIterable list( String skip, String tags, ListViewType listViewType, + String stage, Context context) { PagedIterable inner = this .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context); + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage, context); return Utils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); } @@ -84,136 +85,37 @@ public DataVersionBase get(String resourceGroupName, String workspaceName, Strin } } - public DataVersionBase getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataVersionBaseImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public DataVersionBase createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body) { + DataVersionBaseInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new DataVersionBaseImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private DataVersionsClient serviceClient() { @@ -223,8 +125,4 @@ private DataVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public DataVersionBaseImpl define(String name) { - return new DataVersionBaseImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java index 62f960a4c3aec..d1eeeb4e67a7c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java @@ -44,21 +44,21 @@ public final class DatastoresClientImpl implements DatastoresClient { private final DatastoresService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DatastoresClientImpl. * * @param client the instance of the service client containing this operation class. */ - DatastoresClientImpl(AzureMachineLearningWorkspacesImpl client) { + DatastoresClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(DatastoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDatastores to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDatastores to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -66,8 +66,7 @@ public final class DatastoresClientImpl implements DatastoresClient { public interface DatastoresService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -88,8 +87,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -104,8 +102,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -120,8 +117,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -138,8 +134,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSecrets( @@ -215,7 +210,10 @@ private Mono> listSinglePageAsync( String namesConverted = (names == null) ? null - : names.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")); + : names + .stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); return FluxUtil .withContext( context -> @@ -301,7 +299,10 @@ private Mono> listSinglePageAsync( String namesConverted = (names == null) ? null - : names.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")); + : names + .stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); context = this.client.mergeContext(context); return service .list( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java index 4ee12b6fd24e6..4a002613a7322 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java @@ -50,13 +50,13 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String environmentName; - public EnvironmentContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public EnvironmentContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } @@ -64,9 +64,8 @@ public EnvironmentContainer create() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), Context.NONE); return this; } @@ -74,9 +73,8 @@ public EnvironmentContainer create(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), context); return this; } @@ -84,7 +82,7 @@ public EnvironmentContainer create(Context context) { String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new EnvironmentContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.environmentName = name; } public EnvironmentContainerImpl update() { @@ -95,9 +93,8 @@ public EnvironmentContainer apply() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), Context.NONE); return this; } @@ -105,9 +102,8 @@ public EnvironmentContainer apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), context); return this; } @@ -117,16 +113,16 @@ public EnvironmentContainer apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "environments"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "environments"); } public EnvironmentContainer refresh() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getRegistryEnvironmentContainers() + .getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE) .getValue(); return this; } @@ -135,8 +131,8 @@ public EnvironmentContainer refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) + .getRegistryEnvironmentContainers() + .getWithResponse(resourceGroupName, registryName, environmentName, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java index d569783d4fc89..9eba86fdead7b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java @@ -40,14 +40,14 @@ public final class EnvironmentContainersClientImpl implements EnvironmentContain private final EnvironmentContainersService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of EnvironmentContainersClientImpl. * * @param client the instance of the service client containing this operation class. */ - EnvironmentContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { + EnvironmentContainersClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy .create(EnvironmentContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -55,7 +55,7 @@ public final class EnvironmentContainersClientImpl implements EnvironmentContain } /** - * The interface defining all the services for AzureMachineLearningWorkspacesEnvironmentContainers to be used by the + * The interface defining all the services for AzureMachineLearningServicesEnvironmentContainers to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @@ -63,8 +63,7 @@ public final class EnvironmentContainersClientImpl implements EnvironmentContain public interface EnvironmentContainersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -80,8 +79,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -96,8 +94,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -112,8 +109,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java index acbe2b72b83e8..b41fa86b685e3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java @@ -74,108 +74,30 @@ public EnvironmentContainer get(String resourceGroupName, String workspaceName, } } - public EnvironmentContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnvironmentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + public EnvironmentContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body) { + EnvironmentContainerInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new EnvironmentContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private EnvironmentContainersClient serviceClient() { @@ -185,8 +107,4 @@ private EnvironmentContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public EnvironmentContainerImpl define(String name) { - return new EnvironmentContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java index 653ef01782d9e..87f0ea22c6ca7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java @@ -50,16 +50,17 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String environmentName; private String version; - public EnvironmentVersionImpl withExistingEnvironment(String resourceGroupName, String workspaceName, String name) { + public EnvironmentVersionImpl withExistingEnvironment( + String resourceGroupName, String registryName, String environmentName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.environmentName = environmentName; return this; } @@ -67,10 +68,9 @@ public EnvironmentVersion create() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryEnvironmentVersions() + .createOrUpdate( + resourceGroupName, registryName, environmentName, version, this.innerModel(), Context.NONE); return this; } @@ -78,9 +78,8 @@ public EnvironmentVersion create(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), context); return this; } @@ -99,10 +98,9 @@ public EnvironmentVersion apply() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryEnvironmentVersions() + .createOrUpdate( + resourceGroupName, registryName, environmentName, version, this.innerModel(), Context.NONE); return this; } @@ -110,9 +108,8 @@ public EnvironmentVersion apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), context); return this; } @@ -122,8 +119,8 @@ public EnvironmentVersion apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "environments"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "environments"); this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); } @@ -131,8 +128,8 @@ public EnvironmentVersion refresh() { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getRegistryEnvironmentVersions() + .getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE) .getValue(); return this; } @@ -141,8 +138,8 @@ public EnvironmentVersion refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getEnvironmentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getRegistryEnvironmentVersions() + .getWithResponse(resourceGroupName, registryName, environmentName, version, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java index 0f6b8a58aa6d2..29db23f426b98 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java @@ -40,21 +40,21 @@ public final class EnvironmentVersionsClientImpl implements EnvironmentVersionsC private final EnvironmentVersionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of EnvironmentVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - EnvironmentVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + EnvironmentVersionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(EnvironmentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesEnvironmentVersions to be used by the + * The interface defining all the services for AzureMachineLearningServicesEnvironmentVersions to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @@ -62,8 +62,7 @@ public final class EnvironmentVersionsClientImpl implements EnvironmentVersionsC public interface EnvironmentVersionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -77,14 +76,13 @@ Mono> list( @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -100,9 +98,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -118,9 +114,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -156,6 +150,7 @@ Mono> listNext( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -170,7 +165,8 @@ private Mono> listSinglePageAsync( String orderBy, Integer top, String skip, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -209,6 +205,7 @@ private Mono> listSinglePageAsync( top, skip, listViewType, + stage, accept, context)) .>map( @@ -233,6 +230,7 @@ private Mono> listSinglePageAsync( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -249,6 +247,7 @@ private Mono> listSinglePageAsync( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -286,6 +285,7 @@ private Mono> listSinglePageAsync( top, skip, listViewType, + stage, accept, context) .map( @@ -309,6 +309,7 @@ private Mono> listSinglePageAsync( * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -322,9 +323,10 @@ private PagedFlux listAsync( String orderBy, Integer top, String skip, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -345,8 +347,9 @@ private PagedFlux listAsync(String resourceGroupName, S final Integer top = null; final String skip = null; final ListViewType listViewType = null; + final String stage = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -360,6 +363,7 @@ private PagedFlux listAsync(String resourceGroupName, S * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -375,10 +379,12 @@ private PagedFlux listAsync( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { return new PagedFlux<>( () -> - listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context), + listSinglePageAsync( + resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -399,7 +405,9 @@ public PagedIterable list(String resourceGroupName, Str final Integer top = null; final String skip = null; final ListViewType listViewType = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType)); + final String stage = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage)); } /** @@ -412,6 +420,7 @@ public PagedIterable list(String resourceGroupName, Str * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -427,9 +436,10 @@ public PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context)); + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context)); } /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java index 3c075afbe0d9c..3affbd62b338a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java @@ -43,11 +43,12 @@ public PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context) { PagedIterable inner = this .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage, context); return Utils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); } @@ -84,136 +85,37 @@ public EnvironmentVersion get(String resourceGroupName, String workspaceName, St } } - public EnvironmentVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + EnvironmentVersionInner body, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnvironmentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public EnvironmentVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body) { + EnvironmentVersionInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new EnvironmentVersionImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private EnvironmentVersionsClient serviceClient() { @@ -223,8 +125,4 @@ private EnvironmentVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public EnvironmentVersionImpl define(String name) { - return new EnvironmentVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExportSummaryImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExportSummaryImpl.java new file mode 100644 index 0000000000000..0fb6b3f2e8aa3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExportSummaryImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.models.ExportSummary; +import java.time.OffsetDateTime; + +public final class ExportSummaryImpl implements ExportSummary { + private ExportSummaryInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + ExportSummaryImpl( + ExportSummaryInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public Long exportedRowCount() { + return this.innerModel().exportedRowCount(); + } + + public String labelingJobId() { + return this.innerModel().labelingJobId(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public ExportSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java index 7f27891cd16a6..7e47d6a3c0e30 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java @@ -6,7 +6,7 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner; import com.azure.resourcemanager.machinelearning.models.ExternalFqdnResponse; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; +import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsPropertyBag; import java.util.Collections; import java.util.List; @@ -22,8 +22,8 @@ public final class ExternalFqdnResponseImpl implements ExternalFqdnResponse { this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner); } else { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java new file mode 100644 index 0000000000000..7acc520150a42 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.Feature; +import com.azure.resourcemanager.machinelearning.models.FeatureProperties; + +public final class FeatureImpl implements Feature { + private FeatureInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + FeatureImpl( + FeatureInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeatureProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public FeatureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java new file mode 100644 index 0000000000000..a34a32dd4e880 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java @@ -0,0 +1,746 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.FeatureResourceArmPaginatedResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeaturesClient. */ +public final class FeaturesClientImpl implements FeaturesClient { + /** The proxy service used to perform REST calls. */ + private final FeaturesService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeatures to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("featuresetName") String featuresetName, + @PathParam("featuresetVersion") String featuresetVersion, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, + @QueryParam("featureName") String featureName, + @QueryParam("description") String description, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("featuresetName") String featuresetName, + @PathParam("featuresetVersion") String featuresetVersion, + @PathParam("featureName") String featureName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + this.client.getApiVersion(), + skip, + tags, + featureName, + description, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + this.client.getApiVersion(), + skip, + tags, + featureName, + description, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion) { + final String skip = null; + final String tags = null; + final String featureName = null; + final String description = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion) { + final String skip = null; + final String tags = null; + final String featureName = null; + final String description = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description, + context)); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + featureName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + featureName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName) { + return getWithResponseAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, context) + .block(); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeatureInner get( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName) { + return getWithResponse( + resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java new file mode 100644 index 0000000000000..dbcfbe4b3693d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.Feature; +import com.azure.resourcemanager.machinelearning.models.Features; + +public final class FeaturesImpl implements Features { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesImpl.class); + + private final FeaturesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesImpl( + FeaturesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, featuresetName, featuresetVersion); + return Utils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + featuresetName, + featuresetVersion, + skip, + tags, + featureName, + description, + context); + return Utils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FeatureImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Feature get( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName) { + FeatureInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName); + if (inner != null) { + return new FeatureImpl(inner, this.manager()); + } else { + return null; + } + } + + private FeaturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java new file mode 100644 index 0000000000000..57f427ec478a9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; + +public final class FeaturesetContainerImpl + implements FeaturesetContainer, FeaturesetContainer.Definition, FeaturesetContainer.Update { + private FeaturesetContainerInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturesetContainerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturesetContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + public FeaturesetContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FeaturesetContainer create() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetContainer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturesetContainerImpl( + String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturesetContainerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public FeaturesetContainerImpl update() { + return this; + } + + public FeaturesetContainer apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetContainer apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturesetContainerImpl( + FeaturesetContainerInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "featuresets"); + } + + public FeaturesetContainer refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public FeaturesetContainer refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public FeaturesetContainerImpl withProperties(FeaturesetContainerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java new file mode 100644 index 0000000000000..e59c7f3f3f0b9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java @@ -0,0 +1,1256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeaturesetContainersClient. */ +public final class FeaturesetContainersClientImpl implements FeaturesetContainersClient { + /** The proxy service used to perform REST calls. */ + private final FeaturesetContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesetContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesetContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(FeaturesetContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturesetContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesetContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, + @QueryParam("name") String name, + @QueryParam("description") String description, + @QueryParam("createdBy") String createdBy, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getEntity( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturesetContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync( + String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityAsync(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner getEntity(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturesetContainerInner.class, + FeaturesetContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturesetContainerInner.class, + FeaturesetContainerInner.class, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java new file mode 100644 index 0000000000000..996a5095328f8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainers; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturesetContainersImpl implements FeaturesetContainers { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetContainersImpl.class); + + private final FeaturesetContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesetContainersImpl( + FeaturesetContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new FeaturesetContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context); + return Utils.mapPage(inner, inner1 -> new FeaturesetContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + Response inner = + this.serviceClient().getEntityWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FeaturesetContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturesetContainer getEntity(String resourceGroupName, String workspaceName, String name) { + FeaturesetContainerInner inner = this.serviceClient().getEntity(resourceGroupName, workspaceName, name); + if (inner != null) { + return new FeaturesetContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetContainer getEntityById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getEntityByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private FeaturesetContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturesetContainerImpl define(String name) { + return new FeaturesetContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetJobImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetJobImpl.java new file mode 100644 index 0000000000000..036afc9edcf7f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetJobImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.FeaturesetJob; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreJobType; +import com.azure.resourcemanager.machinelearning.models.JobStatus; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class FeaturesetJobImpl implements FeaturesetJob { + private FeaturesetJobInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + FeaturesetJobImpl( + FeaturesetJobInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Duration duration() { + return this.innerModel().duration(); + } + + public String experimentId() { + return this.innerModel().experimentId(); + } + + public FeatureWindow featureWindow() { + return this.innerModel().featureWindow(); + } + + public String jobId() { + return this.innerModel().jobId(); + } + + public JobStatus status() { + return this.innerModel().status(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public FeaturestoreJobType type() { + return this.innerModel().type(); + } + + public FeaturesetJobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java new file mode 100644 index 0000000000000..b58db0599281d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetJob; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; + +public final class FeaturesetVersionImpl + implements FeaturesetVersion, FeaturesetVersion.Definition, FeaturesetVersion.Update { + private FeaturesetVersionInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturesetVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturesetVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + private String version; + + public FeaturesetVersionImpl withExistingFeatureset(String resourceGroupName, String workspaceName, String name) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.name = name; + return this; + } + + public FeaturesetVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturesetVersionImpl( + String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturesetVersionInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public FeaturesetVersionImpl update() { + return this; + } + + public FeaturesetVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturesetVersionImpl( + FeaturesetVersionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "featuresets"); + this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public FeaturesetVersion refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getValue(); + return this; + } + + public FeaturesetVersion refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturesetVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getValue(); + return this; + } + + public FeaturesetJob backfill(FeaturesetVersionBackfillRequest body) { + return serviceManager.featuresetVersions().backfill(resourceGroupName, workspaceName, name, version, body); + } + + public FeaturesetJob backfill(FeaturesetVersionBackfillRequest body, Context context) { + return serviceManager + .featuresetVersions() + .backfill(resourceGroupName, workspaceName, name, version, body, context); + } + + public PagedIterable listMaterializationJobs() { + return serviceManager + .featuresetVersions() + .listMaterializationJobs(resourceGroupName, workspaceName, name, version); + } + + public PagedIterable listMaterializationJobs( + String skip, String filters, String featureWindowStart, String featureWindowEnd, Context context) { + return serviceManager + .featuresetVersions() + .listMaterializationJobs( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd, + context); + } + + public FeaturesetVersionImpl withProperties(FeaturesetVersionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java new file mode 100644 index 0000000000000..0ad37f308b897 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java @@ -0,0 +1,2252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetJobArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeaturesetVersionsClient. */ +public final class FeaturesetVersionsClientImpl implements FeaturesetVersionsClient { + /** The proxy service used to perform REST calls. */ + private final FeaturesetVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesetVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesetVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy.create(FeaturesetVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturesetVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesetVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, + @QueryParam("versionName") String versionName, + @QueryParam("version") String version, + @QueryParam("description") String description, + @QueryParam("createdBy") String createdBy, + @QueryParam("stage") String stage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturesetVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backfill( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturesetVersionBackfillRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMaterializationJobs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("filters") String filters, + @QueryParam("featureWindowStart") String featureWindowStart, + @QueryParam("featureWindowEnd") String featureWindowEnd, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMaterializationJobsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + deleteAsync(resourceGroupName, workspaceName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String name, String version) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner get(String resourceGroupName, String workspaceName, String name, String version) { + return getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturesetVersionInner.class, + FeaturesetVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturesetVersionInner.class, + FeaturesetVersionInner.class, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backfillWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .backfill( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backfillWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backfill( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetJobInner> beginBackfillAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + Mono>> mono = + backfillWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturesetJobInner.class, + FeaturesetJobInner.class, + this.client.getContext()); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetJobInner> beginBackfillAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + backfillWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FeaturesetJobInner.class, FeaturesetJobInner.class, context); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetJobInner> beginBackfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + return this.beginBackfillAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetJobInner> beginBackfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + return this.beginBackfillAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backfillAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + return beginBackfillAsync(resourceGroupName, workspaceName, name, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backfillAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + return beginBackfillAsync(resourceGroupName, workspaceName, name, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetJobInner backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + return backfillAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetJobInner backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + return backfillAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMaterializationJobsSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listMaterializationJobs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + skip, + filters, + featureWindowStart, + featureWindowEnd, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMaterializationJobsSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMaterializationJobs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + skip, + filters, + featureWindowStart, + featureWindowEnd, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMaterializationJobsAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd) { + return new PagedFlux<>( + () -> + listMaterializationJobsSinglePageAsync( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd), + nextLink -> listMaterializationJobsNextSinglePageAsync(nextLink)); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMaterializationJobsAsync( + String resourceGroupName, String workspaceName, String name, String version) { + final String skip = null; + final String filters = null; + final String featureWindowStart = null; + final String featureWindowEnd = null; + return new PagedFlux<>( + () -> + listMaterializationJobsSinglePageAsync( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd), + nextLink -> listMaterializationJobsNextSinglePageAsync(nextLink)); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMaterializationJobsAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context) { + return new PagedFlux<>( + () -> + listMaterializationJobsSinglePageAsync( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd, + context), + nextLink -> listMaterializationJobsNextSinglePageAsync(nextLink, context)); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMaterializationJobs( + String resourceGroupName, String workspaceName, String name, String version) { + final String skip = null; + final String filters = null; + final String featureWindowStart = null; + final String featureWindowEnd = null; + return new PagedIterable<>( + listMaterializationJobsAsync( + resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd)); + } + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMaterializationJobs( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context) { + return new PagedIterable<>( + listMaterializationJobsAsync( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd, + context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMaterializationJobsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMaterializationJobsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMaterializationJobsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMaterializationJobsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java new file mode 100644 index 0000000000000..16c9687b5ccdf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetJob; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersions; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturesetVersionsImpl implements FeaturesetVersions { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetVersionsImpl.class); + + private final FeaturesetVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesetVersionsImpl( + FeaturesetVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); + return Utils.mapPage(inner, inner1 -> new FeaturesetVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context); + return Utils.mapPage(inner, inner1 -> new FeaturesetVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FeaturesetVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturesetVersion get(String resourceGroupName, String workspaceName, String name, String version) { + FeaturesetVersionInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name, version); + if (inner != null) { + return new FeaturesetVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetJob backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body) { + FeaturesetJobInner inner = this.serviceClient().backfill(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new FeaturesetJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetJob backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context) { + FeaturesetJobInner inner = + this.serviceClient().backfill(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new FeaturesetJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listMaterializationJobs( + String resourceGroupName, String workspaceName, String name, String version) { + PagedIterable inner = + this.serviceClient().listMaterializationJobs(resourceGroupName, workspaceName, name, version); + return Utils.mapPage(inner, inner1 -> new FeaturesetJobImpl(inner1, this.manager())); + } + + public PagedIterable listMaterializationJobs( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listMaterializationJobs( + resourceGroupName, + workspaceName, + name, + version, + skip, + filters, + featureWindowStart, + featureWindowEnd, + context); + return Utils.mapPage(inner, inner1 -> new FeaturesetJobImpl(inner1, this.manager())); + } + + public FeaturesetVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, context); + } + + private FeaturesetVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturesetVersionImpl define(String name) { + return new FeaturesetVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java new file mode 100644 index 0000000000000..afcc924545ca4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; + +public final class FeaturestoreEntityContainerImpl + implements FeaturestoreEntityContainer, FeaturestoreEntityContainer.Definition, FeaturestoreEntityContainer.Update { + private FeaturestoreEntityContainerInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturestoreEntityContainerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturestoreEntityContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + public FeaturestoreEntityContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FeaturestoreEntityContainer create() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityContainer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturestoreEntityContainerImpl( + String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturestoreEntityContainerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public FeaturestoreEntityContainerImpl update() { + return this; + } + + public FeaturestoreEntityContainer apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityContainer apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturestoreEntityContainerImpl( + FeaturestoreEntityContainerInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "featurestoreEntities"); + } + + public FeaturestoreEntityContainer refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public FeaturestoreEntityContainer refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public FeaturestoreEntityContainerImpl withProperties(FeaturestoreEntityContainerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java new file mode 100644 index 0000000000000..27e47e6ed9d6b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeaturestoreEntityContainersClient. */ +public final class FeaturestoreEntityContainersClientImpl implements FeaturestoreEntityContainersClient { + /** The proxy service used to perform REST calls. */ + private final FeaturestoreEntityContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturestoreEntityContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturestoreEntityContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + FeaturestoreEntityContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturestoreEntityContainers to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturestoreEntityContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, + @QueryParam("name") String name, + @QueryParam("description") String description, + @QueryParam("createdBy") String createdBy, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getEntity( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturestoreEntityContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync( + String resourceGroupName, String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync( + String resourceGroupName, String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityAsync( + String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner getEntity(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityContainerInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturestoreEntityContainerInner.class, + FeaturestoreEntityContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityContainerInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturestoreEntityContainerInner.class, + FeaturestoreEntityContainerInner.class, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityContainerInner> + beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityContainerInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner createOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + FeaturestoreEntityContainerInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java new file mode 100644 index 0000000000000..003ea3c77664d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainers; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturestoreEntityContainersImpl implements FeaturestoreEntityContainers { + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityContainersImpl.class); + + private final FeaturestoreEntityContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturestoreEntityContainersImpl( + FeaturestoreEntityContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new FeaturestoreEntityContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + skip, + tags, + listViewType, + pageSize, + name, + description, + createdBy, + context); + return Utils.mapPage(inner, inner1 -> new FeaturestoreEntityContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context) { + Response inner = + this.serviceClient().getEntityWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FeaturestoreEntityContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturestoreEntityContainer getEntity(String resourceGroupName, String workspaceName, String name) { + FeaturestoreEntityContainerInner inner = this.serviceClient().getEntity(resourceGroupName, workspaceName, name); + if (inner != null) { + return new FeaturestoreEntityContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturestoreEntityContainer getEntityById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getEntityByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private FeaturestoreEntityContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturestoreEntityContainerImpl define(String name) { + return new FeaturestoreEntityContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java new file mode 100644 index 0000000000000..6b477a1a0e408 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; + +public final class FeaturestoreEntityVersionImpl + implements FeaturestoreEntityVersion, FeaturestoreEntityVersion.Definition, FeaturestoreEntityVersion.Update { + private FeaturestoreEntityVersionInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturestoreEntityVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturestoreEntityVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + private String version; + + public FeaturestoreEntityVersionImpl withExistingFeaturestoreEntity( + String resourceGroupName, String workspaceName, String name) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.name = name; + return this; + } + + public FeaturestoreEntityVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturestoreEntityVersionImpl( + String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturestoreEntityVersionInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public FeaturestoreEntityVersionImpl update() { + return this; + } + + public FeaturestoreEntityVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturestoreEntityVersionImpl( + FeaturestoreEntityVersionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "featurestoreEntities"); + this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public FeaturestoreEntityVersion refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getValue(); + return this; + } + + public FeaturestoreEntityVersion refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFeaturestoreEntityVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getValue(); + return this; + } + + public FeaturestoreEntityVersionImpl withProperties(FeaturestoreEntityVersionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java new file mode 100644 index 0000000000000..eb69b740c3809 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java @@ -0,0 +1,1456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeaturestoreEntityVersionsClient. */ +public final class FeaturestoreEntityVersionsClientImpl implements FeaturestoreEntityVersionsClient { + /** The proxy service used to perform REST calls. */ + private final FeaturestoreEntityVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturestoreEntityVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturestoreEntityVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + FeaturestoreEntityVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturestoreEntityVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturestoreEntityVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, + @QueryParam("versionName") String versionName, + @QueryParam("version") String version, + @QueryParam("description") String description, + @QueryParam("createdBy") String createdBy, + @QueryParam("stage") String stage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturestoreEntityVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + this.client.getApiVersion(), + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + deleteAsync(resourceGroupName, workspaceName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String name, String version) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner get( + String resourceGroupName, String workspaceName, String name, String version) { + return getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturestoreEntityVersionInner.class, + FeaturestoreEntityVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FeaturestoreEntityVersionInner.class, + FeaturestoreEntityVersionInner.class, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturestoreEntityVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java new file mode 100644 index 0000000000000..2392037ac4def --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersions; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturestoreEntityVersionsImpl implements FeaturestoreEntityVersions { + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityVersionsImpl.class); + + private final FeaturestoreEntityVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturestoreEntityVersionsImpl( + FeaturestoreEntityVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, name); + return Utils.mapPage(inner, inner1 -> new FeaturestoreEntityVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + name, + skip, + tags, + listViewType, + pageSize, + versionName, + version, + description, + createdBy, + stage, + context); + return Utils.mapPage(inner, inner1 -> new FeaturestoreEntityVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FeaturestoreEntityVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturestoreEntityVersion get(String resourceGroupName, String workspaceName, String name, String version) { + FeaturestoreEntityVersionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, name, version); + if (inner != null) { + return new FeaturestoreEntityVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturestoreEntityVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = Utils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", + id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, context); + } + + private FeaturestoreEntityVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturestoreEntityVersionImpl define(String name) { + return new FeaturestoreEntityVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java index 1b26fd5f42d47..1eb8cd7fda000 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java @@ -9,6 +9,8 @@ import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; import com.azure.resourcemanager.machinelearning.models.JobBase; import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; +import com.azure.resourcemanager.machinelearning.models.PartialJobBase; +import com.azure.resourcemanager.machinelearning.models.PartialJobBasePartialResource; public final class JobBaseImpl implements JobBase, JobBase.Definition, JobBase.Update { private JobBaseInner innerObject; @@ -53,6 +55,8 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String id; + private PartialJobBasePartialResource updateBody; + public JobBaseImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; @@ -86,6 +90,7 @@ public JobBase create(Context context) { } public JobBaseImpl update() { + this.updateBody = new PartialJobBasePartialResource(); return this; } @@ -94,7 +99,7 @@ public JobBase apply() { serviceManager .serviceClient() .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE) + .updateWithResponse(resourceGroupName, workspaceName, id, updateBody, Context.NONE) .getValue(); return this; } @@ -104,7 +109,7 @@ public JobBase apply(Context context) { serviceManager .serviceClient() .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), context) + .updateWithResponse(resourceGroupName, workspaceName, id, updateBody, context) .getValue(); return this; } @@ -150,4 +155,9 @@ public JobBaseImpl withProperties(JobBaseProperties properties) { this.innerModel().withProperties(properties); return this; } + + public JobBaseImpl withProperties(PartialJobBase properties) { + this.updateBody.withProperties(properties); + return this; + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java index f19ceaef9cf49..543ae77673ccf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java @@ -12,6 +12,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; @@ -36,6 +37,7 @@ import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; import com.azure.resourcemanager.machinelearning.models.JobBaseResourceArmPaginatedResult; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PartialJobBasePartialResource; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -46,20 +48,20 @@ public final class JobsClientImpl implements JobsClient { private final JobsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of JobsClientImpl. * * @param client the instance of the service client containing this operation class. */ - JobsClientImpl(AzureMachineLearningWorkspacesImpl client) { + JobsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesJobs to be used by the proxy service to + * The interface defining all the services for AzureMachineLearningServicesJobs to be used by the proxy service to * perform REST calls. */ @Host("{$host}") @@ -67,8 +69,7 @@ public final class JobsClientImpl implements JobsClient { public interface JobsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -81,13 +82,15 @@ Mono> list( @QueryParam("jobType") String jobType, @QueryParam("tag") String tag, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("assetName") String assetName, + @QueryParam("scheduled") Boolean scheduled, + @QueryParam("scheduleId") String scheduleId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -102,8 +105,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -116,10 +118,25 @@ Mono> get( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartialJobBasePartialResource body, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -135,8 +152,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> cancel( @@ -169,6 +185,9 @@ Mono> listNext( * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -182,7 +201,10 @@ private Mono> listSinglePageAsync( String skip, String jobType, String tag, - ListViewType listViewType) { + ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -217,6 +239,9 @@ private Mono> listSinglePageAsync( jobType, tag, listViewType, + assetName, + scheduled, + scheduleId, accept, context)) .>map( @@ -240,6 +265,9 @@ private Mono> listSinglePageAsync( * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -255,6 +283,9 @@ private Mono> listSinglePageAsync( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -288,6 +319,9 @@ private Mono> listSinglePageAsync( jobType, tag, listViewType, + assetName, + scheduled, + scheduleId, accept, context) .map( @@ -310,6 +344,9 @@ private Mono> listSinglePageAsync( * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -322,9 +359,22 @@ private PagedFlux listAsync( String skip, String jobType, String tag, - ListViewType listViewType) { + ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType), + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + skip, + jobType, + tag, + listViewType, + assetName, + scheduled, + scheduleId), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -344,8 +394,21 @@ private PagedFlux listAsync(String resourceGroupName, String works final String jobType = null; final String tag = null; final ListViewType listViewType = null; + final String assetName = null; + final Boolean scheduled = null; + final String scheduleId = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType), + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + skip, + jobType, + tag, + listViewType, + assetName, + scheduled, + scheduleId), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -358,6 +421,9 @@ private PagedFlux listAsync(String resourceGroupName, String works * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -372,9 +438,23 @@ private PagedFlux listAsync( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context), + () -> + listSinglePageAsync( + resourceGroupName, + workspaceName, + skip, + jobType, + tag, + listViewType, + assetName, + scheduled, + scheduleId, + context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -394,7 +474,12 @@ public PagedIterable list(String resourceGroupName, String workspa final String jobType = null; final String tag = null; final ListViewType listViewType = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType)); + final String assetName = null; + final Boolean scheduled = null; + final String scheduleId = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId)); } /** @@ -406,6 +491,9 @@ public PagedIterable list(String resourceGroupName, String workspa * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -420,9 +508,22 @@ public PagedIterable list( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context)); + listAsync( + resourceGroupName, + workspaceName, + skip, + jobType, + tag, + listViewType, + assetName, + scheduled, + scheduleId, + context)); } /** @@ -829,6 +930,190 @@ public JobBaseInner get(String resourceGroupName, String workspaceName, String i return getWithResponse(resourceGroupName, workspaceName, id, Context.NONE).getValue(); } + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String id, PartialJobBasePartialResource body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String id, + PartialJobBasePartialResource body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, String id, PartialJobBasePartialResource body) { + return updateWithResponseAsync(resourceGroupName, workspaceName, id, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String id, + PartialJobBasePartialResource body, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, id, body, context).block(); + } + + /** + * Updates a Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the Job. This is case-sensitive. + * @param body Job definition to apply during the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobBaseInner update( + String resourceGroupName, String workspaceName, String id, PartialJobBasePartialResource body) { + return updateWithResponse(resourceGroupName, workspaceName, id, body, Context.NONE).getValue(); + } + /** * Creates and executes a Job. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java index 8acf713adc9b9..b6a619272f864 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java @@ -40,9 +40,24 @@ public PagedIterable list( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context); + this + .serviceClient() + .list( + resourceGroupName, + workspaceName, + skip, + jobType, + tag, + listViewType, + assetName, + scheduled, + scheduleId, + context); return Utils.mapPage(inner, inner1 -> new JobBaseImpl(inner1, this.manager())); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobImpl.java new file mode 100644 index 0000000000000..1adbf90a80840 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; +import com.azure.resourcemanager.machinelearning.models.ExportSummary; +import com.azure.resourcemanager.machinelearning.models.LabelingJob; +import com.azure.resourcemanager.machinelearning.models.LabelingJobProperties; + +public final class LabelingJobImpl implements LabelingJob, LabelingJob.Definition, LabelingJob.Update { + private LabelingJobInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LabelingJobProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LabelingJobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String id; + + public LabelingJobImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public LabelingJob create() { + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .createOrUpdate(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE); + return this; + } + + public LabelingJob create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .createOrUpdate(resourceGroupName, workspaceName, id, this.innerModel(), context); + return this; + } + + LabelingJobImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new LabelingJobInner(); + this.serviceManager = serviceManager; + this.id = name; + } + + public LabelingJobImpl update() { + return this; + } + + public LabelingJob apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .createOrUpdate(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE); + return this; + } + + public LabelingJob apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .createOrUpdate(resourceGroupName, workspaceName, id, this.innerModel(), context); + return this; + } + + LabelingJobImpl( + LabelingJobInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.id = Utils.getValueFromIdByName(innerObject.id(), "labelingJobs"); + } + + public LabelingJob refresh() { + Boolean localIncludeJobInstructions = null; + Boolean localIncludeLabelCategories = null; + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .getWithResponse( + resourceGroupName, + workspaceName, + id, + localIncludeJobInstructions, + localIncludeLabelCategories, + Context.NONE) + .getValue(); + return this; + } + + public LabelingJob refresh(Context context) { + Boolean localIncludeJobInstructions = null; + Boolean localIncludeLabelCategories = null; + this.innerObject = + serviceManager + .serviceClient() + .getLabelingJobs() + .getWithResponse( + resourceGroupName, + workspaceName, + id, + localIncludeJobInstructions, + localIncludeLabelCategories, + context) + .getValue(); + return this; + } + + public ExportSummary exportLabels(ExportSummaryInner body) { + return serviceManager.labelingJobs().exportLabels(resourceGroupName, workspaceName, id, body); + } + + public ExportSummary exportLabels(ExportSummaryInner body, Context context) { + return serviceManager.labelingJobs().exportLabels(resourceGroupName, workspaceName, id, body, context); + } + + public Response pauseWithResponse(Context context) { + return serviceManager.labelingJobs().pauseWithResponse(resourceGroupName, workspaceName, id, context); + } + + public void pause() { + serviceManager.labelingJobs().pause(resourceGroupName, workspaceName, id); + } + + public void resume() { + serviceManager.labelingJobs().resume(resourceGroupName, workspaceName, id); + } + + public void resume(Context context) { + serviceManager.labelingJobs().resume(resourceGroupName, workspaceName, id, context); + } + + public LabelingJobImpl withProperties(LabelingJobProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsClientImpl.java new file mode 100644 index 0000000000000..076e1be776c0f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsClientImpl.java @@ -0,0 +1,1795 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.LabelingJobsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; +import com.azure.resourcemanager.machinelearning.models.LabelingJobResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LabelingJobsClient. */ +public final class LabelingJobsClientImpl implements LabelingJobsClient { + /** The proxy service used to perform REST calls. */ + private final LabelingJobsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of LabelingJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LabelingJobsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy.create(LabelingJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesLabelingJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface LabelingJobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @QueryParam("includeJobInstructions") Boolean includeJobInstructions, + @QueryParam("includeLabelCategories") Boolean includeLabelCategories, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LabelingJobInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportLabels( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExportSummaryInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String skip, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + skip, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String skip, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, top)); + } + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, top, context)); + } + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String id) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, id).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String id, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, id, context).block(); + } + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String id) { + deleteWithResponse(resourceGroupName, workspaceName, id, Context.NONE); + } + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + includeJobInstructions, + includeLabelCategories, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + includeJobInstructions, + includeLabelCategories, + accept, + context); + } + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String id) { + final Boolean includeJobInstructions = null; + final Boolean includeLabelCategories = null; + return getWithResponseAsync( + resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories, context) + .block(); + } + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabelingJobInner get(String resourceGroupName, String workspaceName, String id) { + final Boolean includeJobInstructions = null; + final Boolean includeLabelCategories = null; + return getWithResponse( + resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabelingJobInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, id, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LabelingJobInner.class, + LabelingJobInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabelingJobInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, id, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabelingJobInner.class, LabelingJobInner.class, context); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabelingJobInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, id, body).getSyncPoller(); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabelingJobInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, id, body, context).getSyncPoller(); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, id, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, id, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabelingJobInner createOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, id, body).block(); + } + + /** + * Creates or updates a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body LabelingJob definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabelingJobInner createOrUpdate( + String resourceGroupName, String workspaceName, String id, LabelingJobInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, id, body, context).block(); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportLabelsWithResponseAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportLabels( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportLabelsWithResponseAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportLabels( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportSummaryInner> beginExportLabelsAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + Mono>> mono = + exportLabelsWithResponseAsync(resourceGroupName, workspaceName, id, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExportSummaryInner.class, + ExportSummaryInner.class, + this.client.getContext()); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportSummaryInner> beginExportLabelsAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + exportLabelsWithResponseAsync(resourceGroupName, workspaceName, id, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExportSummaryInner.class, ExportSummaryInner.class, context); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportSummaryInner> beginExportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + return this.beginExportLabelsAsync(resourceGroupName, workspaceName, id, body).getSyncPoller(); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportSummaryInner> beginExportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + return this.beginExportLabelsAsync(resourceGroupName, workspaceName, id, body, context).getSyncPoller(); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportLabelsAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + return beginExportLabelsAsync(resourceGroupName, workspaceName, id, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportLabelsAsync( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + return beginExportLabelsAsync(resourceGroupName, workspaceName, id, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportSummaryInner exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + return exportLabelsAsync(resourceGroupName, workspaceName, id, body).block(); + } + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportSummaryInner exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + return exportLabelsAsync(resourceGroupName, workspaceName, id, body, context).block(); + } + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, String workspaceName, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .pause( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync( + String resourceGroupName, String workspaceName, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .pause( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseAsync(String resourceGroupName, String workspaceName, String id) { + return pauseWithResponseAsync(resourceGroupName, workspaceName, id).flatMap(ignored -> Mono.empty()); + } + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse( + String resourceGroupName, String workspaceName, String id, Context context) { + return pauseWithResponseAsync(resourceGroupName, workspaceName, id, context).block(); + } + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void pause(String resourceGroupName, String workspaceName, String id) { + pauseWithResponse(resourceGroupName, workspaceName, id, Context.NONE); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceGroupName, String workspaceName, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resume( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceGroupName, String workspaceName, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resume( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeAsync( + String resourceGroupName, String workspaceName, String id) { + Mono>> mono = resumeWithResponseAsync(resourceGroupName, workspaceName, id); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumeAsync( + String resourceGroupName, String workspaceName, String id, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = resumeWithResponseAsync(resourceGroupName, workspaceName, id, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResume(String resourceGroupName, String workspaceName, String id) { + return this.beginResumeAsync(resourceGroupName, workspaceName, id).getSyncPoller(); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResume( + String resourceGroupName, String workspaceName, String id, Context context) { + return this.beginResumeAsync(resourceGroupName, workspaceName, id, context).getSyncPoller(); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String workspaceName, String id) { + return beginResumeAsync(resourceGroupName, workspaceName, id) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String workspaceName, String id, Context context) { + return beginResumeAsync(resourceGroupName, workspaceName, id, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resume(String resourceGroupName, String workspaceName, String id) { + resumeAsync(resourceGroupName, workspaceName, id).block(); + } + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resume(String resourceGroupName, String workspaceName, String id, Context context) { + resumeAsync(resourceGroupName, workspaceName, id, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsImpl.java new file mode 100644 index 0000000000000..e17f934f2f0a5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/LabelingJobsImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.LabelingJobsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; +import com.azure.resourcemanager.machinelearning.models.ExportSummary; +import com.azure.resourcemanager.machinelearning.models.LabelingJob; +import com.azure.resourcemanager.machinelearning.models.LabelingJobs; + +public final class LabelingJobsImpl implements LabelingJobs { + private static final ClientLogger LOGGER = new ClientLogger(LabelingJobsImpl.class); + + private final LabelingJobsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public LabelingJobsImpl( + LabelingJobsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new LabelingJobImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, skip, top, context); + return Utils.mapPage(inner, inner1 -> new LabelingJobImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String id, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, id, context); + } + + public void delete(String resourceGroupName, String workspaceName, String id) { + this.serviceClient().delete(resourceGroupName, workspaceName, id); + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LabelingJobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LabelingJob get(String resourceGroupName, String workspaceName, String id) { + LabelingJobInner inner = this.serviceClient().get(resourceGroupName, workspaceName, id); + if (inner != null) { + return new LabelingJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExportSummary exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body) { + ExportSummaryInner inner = this.serviceClient().exportLabels(resourceGroupName, workspaceName, id, body); + if (inner != null) { + return new ExportSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExportSummary exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context) { + ExportSummaryInner inner = + this.serviceClient().exportLabels(resourceGroupName, workspaceName, id, body, context); + if (inner != null) { + return new ExportSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response pauseWithResponse( + String resourceGroupName, String workspaceName, String id, Context context) { + return this.serviceClient().pauseWithResponse(resourceGroupName, workspaceName, id, context); + } + + public void pause(String resourceGroupName, String workspaceName, String id) { + this.serviceClient().pause(resourceGroupName, workspaceName, id); + } + + public void resume(String resourceGroupName, String workspaceName, String id) { + this.serviceClient().resume(resourceGroupName, workspaceName, id); + } + + public void resume(String resourceGroupName, String workspaceName, String id, Context context) { + this.serviceClient().resume(resourceGroupName, workspaceName, id, context); + } + + public LabelingJob getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String varId = Utils.getValueFromIdByName(id, "labelingJobs"); + if (varId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labelingJobs'.", id))); + } + Boolean localIncludeJobInstructions = null; + Boolean localIncludeLabelCategories = null; + return this + .getWithResponse( + resourceGroupName, + workspaceName, + varId, + localIncludeJobInstructions, + localIncludeLabelCategories, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, Boolean includeJobInstructions, Boolean includeLabelCategories, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String varId = Utils.getValueFromIdByName(id, "labelingJobs"); + if (varId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labelingJobs'.", id))); + } + return this + .getWithResponse( + resourceGroupName, workspaceName, varId, includeJobInstructions, includeLabelCategories, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String varId = Utils.getValueFromIdByName(id, "labelingJobs"); + if (varId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labelingJobs'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, varId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String varId = Utils.getValueFromIdByName(id, "labelingJobs"); + if (varId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labelingJobs'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, varId, context); + } + + private LabelingJobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public LabelingJobImpl define(String name) { + return new LabelingJobImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java index 02beede5a627c..e61896879b978 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java @@ -22,14 +22,6 @@ public final class ListWorkspaceKeysResultImpl implements ListWorkspaceKeysResul this.serviceManager = serviceManager; } - public String userStorageKey() { - return this.innerModel().userStorageKey(); - } - - public String userStorageResourceId() { - return this.innerModel().userStorageResourceId(); - } - public String appInsightsInstrumentationKey() { return this.innerModel().appInsightsInstrumentationKey(); } @@ -47,6 +39,14 @@ public ListNotebookKeysResult notebookAccessKeys() { } } + public String userStorageArmId() { + return this.innerModel().userStorageArmId(); + } + + public String userStorageKey() { + return this.innerModel().userStorageKey(); + } + public ListWorkspaceKeysResultInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java new file mode 100644 index 0000000000000..7c5b96999249b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkStatus; + +public final class ManagedNetworkProvisionStatusImpl implements ManagedNetworkProvisionStatus { + private ManagedNetworkProvisionStatusInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + ManagedNetworkProvisionStatusImpl( + ManagedNetworkProvisionStatusInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean sparkReady() { + return this.innerModel().sparkReady(); + } + + public ManagedNetworkStatus status() { + return this.innerModel().status(); + } + + public ManagedNetworkProvisionStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java new file mode 100644 index 0000000000000..85288a57aa298 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. */ +public final class ManagedNetworkProvisionsClientImpl implements ManagedNetworkProvisionsClient { + /** The proxy service used to perform REST calls. */ + private final ManagedNetworkProvisionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of ManagedNetworkProvisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkProvisionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(ManagedNetworkProvisionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesManagedNetworkProvisions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface ManagedNetworkProvisionsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> provisionManagedNetwork( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedNetworkProvisionOptions body, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> provisionManagedNetworkWithResponseAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .provisionManagedNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> provisionManagedNetworkWithResponseAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .provisionManagedNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body) { + Mono>> mono = + provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, + this.client.getContext()); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + Mono>> mono = + provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, + this.client.getContext()); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, + context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return this.beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body).getSyncPoller(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + return this.beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context).getSyncPoller(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body) { + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync( + String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return provisionManagedNetworkAsync(resourceGroupName, workspaceName, body).block(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + return provisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context).block(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java new file mode 100644 index 0000000000000..2dbddcab78d7f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisions; + +public final class ManagedNetworkProvisionsImpl implements ManagedNetworkProvisions { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkProvisionsImpl.class); + + private final ManagedNetworkProvisionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public ManagedNetworkProvisionsImpl( + ManagedNetworkProvisionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName) { + ManagedNetworkProvisionStatusInner inner = + this.serviceClient().provisionManagedNetwork(resourceGroupName, workspaceName); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + ManagedNetworkProvisionStatusInner inner = + this.serviceClient().provisionManagedNetwork(resourceGroupName, workspaceName, body, context); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ManagedNetworkProvisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java new file mode 100644 index 0000000000000..48288ddec1b67 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.models.IsolationMode; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import java.util.Collections; +import java.util.Map; + +public final class ManagedNetworkSettingsImpl implements ManagedNetworkSettings { + private ManagedNetworkSettingsInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + ManagedNetworkSettingsImpl( + ManagedNetworkSettingsInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public IsolationMode isolationMode() { + return this.innerModel().isolationMode(); + } + + public String networkId() { + return this.innerModel().networkId(); + } + + public Map outboundRules() { + Map inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedNetworkProvisionStatus status() { + ManagedNetworkProvisionStatusInner inner = this.innerModel().status(); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNetworkSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java new file mode 100644 index 0000000000000..2d9f0e42bbdad --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java @@ -0,0 +1,1129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedNetworkSettingsRulesClient. */ +public final class ManagedNetworkSettingsRulesClientImpl implements ManagedNetworkSettingsRulesClient { + /** The proxy service used to perform REST calls. */ + private final ManagedNetworkSettingsRulesService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of ManagedNetworkSettingsRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkSettingsRulesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + ManagedNetworkSettingsRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesManagedNetworkSettingsRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface ManagedNetworkSettingsRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OutboundRuleBasicResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String ruleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String ruleName) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, ruleName).getSyncPoller(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleName) { + deleteAsync(resourceGroupName, workspaceName, ruleName).block(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + deleteAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String ruleName) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner get(String resourceGroupName, String workspaceName, String ruleName) { + return getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE).getValue(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleBasicResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OutboundRuleBasicResourceInner.class, + OutboundRuleBasicResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleBasicResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OutboundRuleBasicResourceInner.class, + OutboundRuleBasicResourceInner.class, + context); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body).getSyncPoller(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context).getSyncPoller(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body).block(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + OutboundRuleBasicResourceInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java new file mode 100644 index 0000000000000..156e0f2d4620f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettingsRules; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleBasicResource; + +public final class ManagedNetworkSettingsRulesImpl implements ManagedNetworkSettingsRules { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkSettingsRulesImpl.class); + + private final ManagedNetworkSettingsRulesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public ManagedNetworkSettingsRulesImpl( + ManagedNetworkSettingsRulesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String ruleName) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleName); + } + + public void delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleName, context); + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OutboundRuleBasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OutboundRuleBasicResource get(String resourceGroupName, String workspaceName, String ruleName) { + OutboundRuleBasicResourceInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleName); + if (inner != null) { + return new OutboundRuleBasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public OutboundRuleBasicResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, workspaceName, ruleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, workspaceName, ruleName, context); + } + + private ManagedNetworkSettingsRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public OutboundRuleBasicResourceImpl define(String name) { + return new OutboundRuleBasicResourceImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java index dc2e9e476a07f..8e02d001475eb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java @@ -49,13 +49,13 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String modelName; - public ModelContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public ModelContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } @@ -63,9 +63,8 @@ public ModelContainer create() { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), Context.NONE); return this; } @@ -73,16 +72,15 @@ public ModelContainer create(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), context); return this; } ModelContainerImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new ModelContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.modelName = name; } public ModelContainerImpl update() { @@ -93,9 +91,8 @@ public ModelContainer apply() { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), Context.NONE); return this; } @@ -103,9 +100,8 @@ public ModelContainer apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), context); return this; } @@ -115,16 +111,16 @@ public ModelContainer apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "models"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.modelName = Utils.getValueFromIdByName(innerObject.id(), "models"); } public ModelContainer refresh() { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getRegistryModelContainers() + .getWithResponse(resourceGroupName, registryName, modelName, Context.NONE) .getValue(); return this; } @@ -133,8 +129,8 @@ public ModelContainer refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) + .getRegistryModelContainers() + .getWithResponse(resourceGroupName, registryName, modelName, context) .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java index 85257b0ad80f5..daa9d4adf43c5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java @@ -40,21 +40,21 @@ public final class ModelContainersClientImpl implements ModelContainersClient { private final ModelContainersService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ModelContainersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ModelContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { + ModelContainersClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ModelContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesModelContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesModelContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -62,8 +62,7 @@ public final class ModelContainersClientImpl implements ModelContainersClient { public interface ModelContainersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -80,8 +79,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -96,8 +94,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -112,8 +109,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java index d45d40ce56ae0..9f8487328cd02 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java @@ -79,108 +79,29 @@ public ModelContainer get(String resourceGroupName, String workspaceName, String } } - public ModelContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, ModelContainerInner body, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ModelContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + public ModelContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, ModelContainerInner body) { + ModelContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new ModelContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private ModelContainersClient serviceClient() { @@ -190,8 +111,4 @@ private ModelContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ModelContainerImpl define(String name) { - return new ModelContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java index 8d4bf21616863..2d3c3af1f553d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java @@ -4,11 +4,16 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; import com.azure.resourcemanager.machinelearning.models.ModelVersion; import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import com.azure.resourcemanager.machinelearning.models.PackageResponse; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class ModelVersionImpl implements ModelVersion, ModelVersion.Definition, ModelVersion.Update { private ModelVersionInner innerObject; @@ -49,16 +54,16 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String modelName; private String version; - public ModelVersionImpl withExistingModel(String resourceGroupName, String workspaceName, String name) { + public ModelVersionImpl withExistingModel(String resourceGroupName, String registryName, String modelName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.modelName = modelName; return this; } @@ -66,10 +71,8 @@ public ModelVersion create() { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), Context.NONE); return this; } @@ -77,9 +80,8 @@ public ModelVersion create(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), context); return this; } @@ -97,10 +99,8 @@ public ModelVersion apply() { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), Context.NONE); return this; } @@ -108,9 +108,8 @@ public ModelVersion apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), context); return this; } @@ -120,8 +119,8 @@ public ModelVersion apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "models"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.modelName = Utils.getValueFromIdByName(innerObject.id(), "models"); this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); } @@ -129,8 +128,8 @@ public ModelVersion refresh() { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getRegistryModelVersions() + .getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE) .getValue(); return this; } @@ -139,12 +138,38 @@ public ModelVersion refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getModelVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getRegistryModelVersions() + .getWithResponse(resourceGroupName, registryName, modelName, version, context) .getValue(); return this; } + public PackageResponse packageMethod(PackageRequest body) { + return serviceManager + .registryModelVersions() + .packageMethod(resourceGroupName, registryName, modelName, version, body); + } + + public PackageResponse packageMethod(PackageRequest body, Context context) { + return serviceManager + .registryModelVersions() + .packageMethod(resourceGroupName, registryName, modelName, version, body, context); + } + + public Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context) { + return serviceManager + .registryModelVersions() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, modelName, version, body, context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager + .registryModelVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, modelName, version, body); + } + public ModelVersionImpl withProperties(ModelVersionProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java index 7c3ba0c615b06..17ae98cebed32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,12 +27,19 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ModelVersionsClient. */ @@ -40,21 +48,21 @@ public final class ModelVersionsClientImpl implements ModelVersionsClient { private final ModelVersionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ModelVersionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ModelVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + ModelVersionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ModelVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesModelVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesModelVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -62,8 +70,7 @@ public final class ModelVersionsClientImpl implements ModelVersionsClient { public interface ModelVersionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -83,13 +90,13 @@ Mono> list( @QueryParam("properties") String properties, @QueryParam("feed") String feed, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -105,8 +112,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -122,8 +128,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -138,6 +143,23 @@ Mono> createOrUpdate( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> packageMethod( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PackageRequest body, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -165,6 +187,7 @@ Mono> listNext( * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -185,7 +208,8 @@ private Mono> listSinglePageAsync( String tags, String properties, String feed, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -230,6 +254,7 @@ private Mono> listSinglePageAsync( properties, feed, listViewType, + stage, accept, context)) .>map( @@ -260,6 +285,7 @@ private Mono> listSinglePageAsync( * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -282,6 +308,7 @@ private Mono> listSinglePageAsync( String properties, String feed, ListViewType listViewType, + String stage, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -325,6 +352,7 @@ private Mono> listSinglePageAsync( properties, feed, listViewType, + stage, accept, context) .map( @@ -354,6 +382,7 @@ private Mono> listSinglePageAsync( * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -373,7 +402,8 @@ private PagedFlux listAsync( String tags, String properties, String feed, - ListViewType listViewType) { + ListViewType listViewType, + String stage) { return new PagedFlux<>( () -> listSinglePageAsync( @@ -389,7 +419,8 @@ private PagedFlux listAsync( tags, properties, feed, - listViewType), + listViewType, + stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -416,6 +447,7 @@ private PagedFlux listAsync(String resourceGroupName, String final String properties = null; final String feed = null; final ListViewType listViewType = null; + final String stage = null; return new PagedFlux<>( () -> listSinglePageAsync( @@ -431,7 +463,8 @@ private PagedFlux listAsync(String resourceGroupName, String tags, properties, feed, - listViewType), + listViewType, + stage), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -451,6 +484,7 @@ private PagedFlux listAsync(String resourceGroupName, String * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -472,6 +506,7 @@ private PagedFlux listAsync( String properties, String feed, ListViewType listViewType, + String stage, Context context) { return new PagedFlux<>( () -> @@ -489,6 +524,7 @@ private PagedFlux listAsync( properties, feed, listViewType, + stage, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -516,6 +552,7 @@ public PagedIterable list(String resourceGroupName, String wo final String properties = null; final String feed = null; final ListViewType listViewType = null; + final String stage = null; return new PagedIterable<>( listAsync( resourceGroupName, @@ -530,7 +567,8 @@ public PagedIterable list(String resourceGroupName, String wo tags, properties, feed, - listViewType)); + listViewType, + stage)); } /** @@ -549,6 +587,7 @@ public PagedIterable list(String resourceGroupName, String wo * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -570,6 +609,7 @@ public PagedIterable list( String properties, String feed, ListViewType listViewType, + String stage, Context context) { return new PagedIterable<>( listAsync( @@ -586,6 +626,7 @@ public PagedIterable list( properties, feed, listViewType, + stage, context)); } @@ -1125,6 +1166,344 @@ public ModelVersionInner createOrUpdate( .getValue(); } + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packageMethodWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .packageMethod( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packageMethodWithResponseAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .packageMethod( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResponseInner> beginPackageMethodAsync( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + Mono>> mono = + packageMethodWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PackageResponseInner.class, + PackageResponseInner.class, + this.client.getContext()); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResponseInner> beginPackageMethodAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + packageMethodWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PackageResponseInner.class, PackageResponseInner.class, context); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + return this.beginPackageMethodAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + return this + .beginPackageMethodAsync(resourceGroupName, workspaceName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packageMethodAsync( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + return beginPackageMethodAsync(resourceGroupName, workspaceName, name, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packageMethodAsync( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + return beginPackageMethodAsync(resourceGroupName, workspaceName, name, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResponseInner packageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + return packageMethodAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResponseInner packageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + return packageMethodAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java index c592838cdb9c1..d69df81b9b598 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java @@ -11,9 +11,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; import com.azure.resourcemanager.machinelearning.models.ModelVersion; import com.azure.resourcemanager.machinelearning.models.ModelVersions; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import com.azure.resourcemanager.machinelearning.models.PackageResponse; public final class ModelVersionsImpl implements ModelVersions { private static final ClientLogger LOGGER = new ClientLogger(ModelVersionsImpl.class); @@ -48,6 +51,7 @@ public PagedIterable list( String properties, String feed, ListViewType listViewType, + String stage, Context context) { PagedIterable inner = this @@ -66,6 +70,7 @@ public PagedIterable list( properties, feed, listViewType, + stage, context); return Utils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); } @@ -103,136 +108,64 @@ public ModelVersion get(String resourceGroupName, String workspaceName, String n } } - public ModelVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + ModelVersionInner body, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ModelVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public ModelVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body) { + ModelVersionInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new ModelVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public PackageResponse packageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body) { + PackageResponseInner inner = + this.serviceClient().packageMethod(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new PackageResponseImpl(inner, this.manager()); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public PackageResponse packageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context) { + PackageResponseInner inner = + this.serviceClient().packageMethod(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new PackageResponseImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private ModelVersionsClient serviceClient() { @@ -242,8 +175,4 @@ private ModelVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ModelVersionImpl define(String name) { - return new ModelVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java index 56f19f2680b1c..761768e0e9cfd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java @@ -19,28 +19,24 @@ public final class NotebookAccessTokenResultImpl implements NotebookAccessTokenR this.serviceManager = serviceManager; } - public String notebookResourceId() { - return this.innerModel().notebookResourceId(); - } - - public String hostname() { - return this.innerModel().hostname(); + public String accessToken() { + return this.innerModel().accessToken(); } - public String publicDns() { - return this.innerModel().publicDns(); + public Integer expiresIn() { + return this.innerModel().expiresIn(); } - public String accessToken() { - return this.innerModel().accessToken(); + public String hostname() { + return this.innerModel().hostname(); } - public String tokenType() { - return this.innerModel().tokenType(); + public String notebookResourceId() { + return this.innerModel().notebookResourceId(); } - public Integer expiresIn() { - return this.innerModel().expiresIn(); + public String publicDns() { + return this.innerModel().publicDns(); } public String refreshToken() { @@ -51,6 +47,10 @@ public String scope() { return this.innerModel().scope(); } + public String tokenType() { + return this.innerModel().tokenType(); + } + public NotebookAccessTokenResultInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java index 79a6782c20d9b..ce6e39e9acd28 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java @@ -24,14 +24,18 @@ public String fqdn() { return this.innerModel().fqdn(); } - public String resourceId() { - return this.innerModel().resourceId(); + public Boolean isPrivateLinkEnabled() { + return this.innerModel().isPrivateLinkEnabled(); } public NotebookPreparationError notebookPreparationError() { return this.innerModel().notebookPreparationError(); } + public String resourceId() { + return this.innerModel().resourceId(); + } + public NotebookResourceInfoInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java index 8008e9361ade5..e8d8d59cb2b24 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java @@ -51,31 +51,29 @@ public final class OnlineDeploymentsClientImpl implements OnlineDeploymentsClien private final OnlineDeploymentsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OnlineDeploymentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OnlineDeploymentsClientImpl(AzureMachineLearningWorkspacesImpl client) { + OnlineDeploymentsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(OnlineDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOnlineDeployments to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesOnlineDeployments to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface OnlineDeploymentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -93,9 +91,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -111,9 +107,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -129,9 +123,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -148,9 +140,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -167,9 +157,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}/getLogs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getLogs( @@ -186,9 +174,7 @@ Mono> getLogs( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}/skus") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSkus( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java index 07f7cfd7be987..3081a4589abc9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java @@ -52,21 +52,21 @@ public final class OnlineEndpointsClientImpl implements OnlineEndpointsClient { private final OnlineEndpointsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OnlineEndpointsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OnlineEndpointsClientImpl(AzureMachineLearningWorkspacesImpl client) { + OnlineEndpointsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(OnlineEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOnlineEndpoints to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesOnlineEndpoints to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @@ -74,8 +74,7 @@ public final class OnlineEndpointsClientImpl implements OnlineEndpointsClient { public interface OnlineEndpointsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -96,8 +95,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -112,8 +110,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -128,8 +125,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -145,8 +141,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -162,9 +157,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @@ -179,9 +172,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/regenerateKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> regenerateKeys( @@ -197,8 +188,7 @@ Mono>> regenerateKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getToken( @@ -2047,7 +2037,7 @@ public void regenerateKeys( } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2100,7 +2090,7 @@ private Mono> getTokenWithResponseAsync( } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2151,7 +2141,7 @@ private Mono> getTokenWithResponseAsync( } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2169,7 +2159,7 @@ private Mono getTokenAsync( } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2187,7 +2177,7 @@ public Response getTokenWithResponse( } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java index da8db6fc97aac..b38b320cf748c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java @@ -35,21 +35,21 @@ public final class OperationsClientImpl implements OperationsClient { private final OperationsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureMachineLearningWorkspacesImpl client) { + OperationsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOperations to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesOperations to be used by the proxy * service to perform REST calls. */ @Host("{$host}") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java new file mode 100644 index 0000000000000..8a190d1d37aa5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleBasicResource; + +public final class OutboundRuleBasicResourceImpl + implements OutboundRuleBasicResource, OutboundRuleBasicResource.Definition, OutboundRuleBasicResource.Update { + private OutboundRuleBasicResourceInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OutboundRule properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OutboundRuleBasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String ruleName; + + public OutboundRuleBasicResourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public OutboundRuleBasicResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public OutboundRuleBasicResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl( + String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new OutboundRuleBasicResourceInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public OutboundRuleBasicResourceImpl update() { + return this; + } + + public OutboundRuleBasicResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public OutboundRuleBasicResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl( + OutboundRuleBasicResourceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.ruleName = Utils.getValueFromIdByName(innerObject.id(), "outboundRules"); + } + + public OutboundRuleBasicResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public OutboundRuleBasicResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedNetworkSettingsRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, context) + .getValue(); + return this; + } + + public OutboundRuleBasicResourceImpl withProperties(OutboundRule properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PackageResponseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PackageResponseImpl.java new file mode 100644 index 0000000000000..d8b48c6aaed0c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PackageResponseImpl.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentSource; +import com.azure.resourcemanager.machinelearning.models.InferencingServer; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageBuildState; +import com.azure.resourcemanager.machinelearning.models.PackageResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PackageResponseImpl implements PackageResponse { + private PackageResponseInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + PackageResponseImpl( + PackageResponseInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BaseEnvironmentSource baseEnvironmentSource() { + return this.innerModel().baseEnvironmentSource(); + } + + public String buildId() { + return this.innerModel().buildId(); + } + + public PackageBuildState buildState() { + return this.innerModel().buildState(); + } + + public Map environmentVariables() { + Map inner = this.innerModel().environmentVariables(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public InferencingServer inferencingServer() { + return this.innerModel().inferencingServer(); + } + + public List inputs() { + List inner = this.innerModel().inputs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String logUrl() { + return this.innerModel().logUrl(); + } + + public ModelConfiguration modelConfiguration() { + return this.innerModel().modelConfiguration(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String targetEnvironmentId() { + return this.innerModel().targetEnvironmentId(); + } + + public PackageResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java new file mode 100644 index 0000000000000..ce8b51c43cd07 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.BlobReferenceForConsumptionDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +public final class PendingUploadResponseDtoImpl implements PendingUploadResponseDto { + private PendingUploadResponseDtoInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + PendingUploadResponseDtoImpl( + PendingUploadResponseDtoInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.innerModel().blobReferenceForConsumption(); + } + + public String pendingUploadId() { + return this.innerModel().pendingUploadId(); + } + + public PendingUploadType pendingUploadType() { + return this.innerModel().pendingUploadType(); + } + + public PendingUploadResponseDtoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java index edc0d80a01ead..4a54b9eb2225c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java @@ -9,11 +9,11 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspacePrivateEndpointResource; import java.util.Collections; import java.util.Map; @@ -43,6 +43,10 @@ public String location() { return this.innerModel().location(); } + public Sku sku() { + return this.innerModel().sku(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -52,15 +56,11 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - public SystemData systemData() { return this.innerModel().systemData(); } - public PrivateEndpoint privateEndpoint() { + public WorkspacePrivateEndpointResource privateEndpoint() { return this.innerModel().privateEndpoint(); } @@ -214,7 +214,7 @@ public PrivateEndpointConnectionImpl withSku(Sku sku) { return this; } - public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + public PrivateEndpointConnectionImpl withPrivateEndpoint(WorkspacePrivateEndpointResource privateEndpoint) { this.innerModel().withPrivateEndpoint(privateEndpoint); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java index a2ee937022f0f..ac498d54c3e30 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java @@ -39,14 +39,14 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi private final PrivateEndpointConnectionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateEndpointConnectionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + PrivateEndpointConnectionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy .create( @@ -55,35 +55,32 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi } /** - * The interface defining all the services for AzureMachineLearningWorkspacesPrivateEndpointConnections to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -94,43 +91,39 @@ Mono> get( Context context); @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> get( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner body, @HeaderParam("Accept") String accept, Context context); } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -149,6 +142,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -156,12 +155,6 @@ private Mono> listSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -169,10 +162,10 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) .>map( @@ -183,7 +176,7 @@ private Mono> listSinglePageAsync( } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -203,6 +196,12 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -210,21 +209,15 @@ private Mono> listSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) .map( @@ -234,7 +227,7 @@ private Mono> listSinglePageAsync( } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -250,7 +243,7 @@ private PagedFlux listAsync(String resourceGroup } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -268,7 +261,7 @@ private PagedFlux listAsync( } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -284,7 +277,7 @@ public PagedIterable list(String resourceGroupNa } /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -302,19 +295,18 @@ public PagedIterable list( } /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> deleteWithResponseAsync( String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono @@ -346,7 +338,7 @@ private Mono> getWithResponseAsync( .withContext( context -> service - .get( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -359,20 +351,19 @@ private Mono> getWithResponseAsync( } /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> deleteWithResponseAsync( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -402,7 +393,7 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -414,67 +405,63 @@ private Mono> getWithResponseAsync( } /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( + private Mono deleteAsync( String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); } /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( + public Response deleteWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .block(); } /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) - .getValue(); + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); } /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -482,11 +469,8 @@ public PrivateEndpointConnectionInner get( * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -512,36 +496,29 @@ private Mono> createOrUpdateWithRespons new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), - properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -550,12 +527,8 @@ private Mono> createOrUpdateWithRespons * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -581,56 +554,44 @@ private Mono> createOrUpdateWithRespons new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), - properties, accept, context); } /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + private Mono getAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -638,54 +599,48 @@ private Mono createOrUpdateAsync( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context) - .block(); + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); } /** - * Update the state of specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. - * @param properties The private endpoint connection properties. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties, Context.NONE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -711,38 +666,50 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -768,69 +735,93 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .createOrUpdate( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), + body, accept, context); } /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) - .flatMap(ignored -> Mono.empty()); + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, body, context) .block(); } /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to approve or reject a PE connection. This method must validate and forward the call to NRP. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. + * @param body PrivateEndpointConnection object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner body) { + return createOrUpdateWithResponse( + resourceGroupName, workspaceName, privateEndpointConnectionName, body, Context.NONE) + .getValue(); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java index 33910826bfaf3..923256d8ea2f0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java @@ -41,6 +41,17 @@ public PagedIterable list( return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); + } + public Response getWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { Response inner = @@ -69,17 +80,6 @@ public PrivateEndpointConnection get( } } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); - } - - public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); - } - public PrivateEndpointConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..bb2d18f82f985 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String location() { + return this.innerModel().location(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java deleted file mode 100644 index 14109bebe8033..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResourceListResult; -import java.util.Collections; -import java.util.List; - -public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { - private PrivateLinkResourceListResultInner innerObject; - - private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - - PrivateLinkResourceListResultImpl( - PrivateLinkResourceListResultInner innerObject, - com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PrivateLinkResourceListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java index e5f6ffba120f0..e6b2a218ec231 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java @@ -16,13 +16,18 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.machinelearning.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ @@ -31,14 +36,14 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource private final PrivateLinkResourcesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. * * @param client the instance of the service client containing this operation class. */ - PrivateLinkResourcesClientImpl(AzureMachineLearningWorkspacesImpl client) { + PrivateLinkResourcesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -46,7 +51,7 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource } /** - * The interface defining all the services for AzureMachineLearningWorkspacesPrivateLinkResources to be used by the + * The interface defining all the services for AzureMachineLearningServicesPrivateLinkResources to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @@ -54,11 +59,10 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -69,18 +73,22 @@ Mono> list( } /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace along with {@link Response} on - * successful completion of {@link Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( + private Mono> listSinglePageAsync( String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono @@ -114,11 +122,19 @@ private Mono> listWithResponseAsync this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -126,11 +142,11 @@ private Mono> listWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace along with {@link Response} on - * successful completion of {@link Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( + private Mono> listSinglePageAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -161,27 +177,38 @@ private Mono> listWithResponseAsync workspaceName, this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); } /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace on successful completion of {@link - * Mono}. + * @return a list of private link resources as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String workspaceName) { - return listWithResponseAsync(resourceGroupName, workspaceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); } /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -189,26 +216,51 @@ private Mono listAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace along with {@link Response}. + * @return a list of private link resources as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); } /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace. + * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceListResultInner list(String resourceGroupName, String workspaceName) { - return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java index d230fde3cbf93..0408c502f2a8e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.machinelearning.implementation; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.PrivateLinkResources; public final class PrivateLinkResourcesImpl implements PrivateLinkResources { @@ -27,28 +26,15 @@ public PrivateLinkResourcesImpl( this.serviceManager = serviceManager; } - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PrivateLinkResourceListResult list(String resourceGroupName, String workspaceName) { - PrivateLinkResourceListResultInner inner = this.serviceClient().list(resourceGroupName, workspaceName); - if (inner != null) { - return new PrivateLinkResourceListResultImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } private PrivateLinkResourcesClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java index d639dc8a9983e..2ee62c5f0219c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java @@ -40,29 +40,28 @@ public final class QuotasClientImpl implements QuotasClient { private final QuotasService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of QuotasClientImpl. * * @param client the instance of the service client containing this operation class. */ - QuotasClientImpl(AzureMachineLearningWorkspacesImpl client) { + QuotasClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesQuotas to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesQuotas to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface QuotasService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}" - + "/updateQuotas") + "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java new file mode 100644 index 0000000000000..13e15158bc071 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java @@ -0,0 +1,1703 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; +import com.azure.resourcemanager.machinelearning.models.RegistryTrackedResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public final class RegistriesClientImpl implements RegistriesClient { + /** The proxy service used to perform REST calls. */ + private final RegistriesService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistriesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy.create(RegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistriesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartialRegistryPartialTrackedResource body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegistryInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> removeRegions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegistryInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { + return this.beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName) { + deleteAsync(resourceGroupName, registryName).block(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, Context context) { + deleteAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body) { + return updateWithResponseAsync(resourceGroupName, registryName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body, Context context) { + return updateWithResponseAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update( + String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body) { + return updateWithResponse(resourceGroupName, registryName, body, Context.NONE).getValue(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, RegistryInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, registryName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RegistryInner.class, + RegistryInner.class, + this.client.getContext()); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, RegistryInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, body).getSyncPoller(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, body, context).getSyncPoller(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, body).block(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner createOrUpdate( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeRegionsWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removeRegions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeRegionsWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removeRegions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginRemoveRegionsAsync( + String resourceGroupName, String registryName, RegistryInner body) { + Mono>> mono = removeRegionsWithResponseAsync(resourceGroupName, registryName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RegistryInner.class, + RegistryInner.class, + this.client.getContext()); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginRemoveRegionsAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + removeRegionsWithResponseAsync(resourceGroupName, registryName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginRemoveRegions( + String resourceGroupName, String registryName, RegistryInner body) { + return this.beginRemoveRegionsAsync(resourceGroupName, registryName, body).getSyncPoller(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginRemoveRegions( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return this.beginRemoveRegionsAsync(resourceGroupName, registryName, body, context).getSyncPoller(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeRegionsAsync(String resourceGroupName, String registryName, RegistryInner body) { + return beginRemoveRegionsAsync(resourceGroupName, registryName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeRegionsAsync( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return beginRemoveRegionsAsync(resourceGroupName, registryName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body) { + return removeRegionsAsync(resourceGroupName, registryName, body).block(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner removeRegions( + String resourceGroupName, String registryName, RegistryInner body, Context context) { + return removeRegionsAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..6b6e120067a68 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.Registries; +import com.azure.resourcemanager.machinelearning.models.Registry; + +public final class RegistriesImpl implements Registries { + private static final ClientLogger LOGGER = new ClientLogger(RegistriesImpl.class); + + private final RegistriesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistriesImpl( + RegistriesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String registryName) { + this.serviceClient().delete(resourceGroupName, registryName); + } + + public void delete(String resourceGroupName, String registryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Registry getByResourceGroup(String resourceGroupName, String registryName) { + RegistryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, registryName); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body) { + RegistryInner inner = this.serviceClient().removeRegions(resourceGroupName, registryName, body); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context) { + RegistryInner inner = this.serviceClient().removeRegions(resourceGroupName, registryName, body, context); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, context); + } + + private RegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public RegistryImpl define(String name) { + return new RegistryImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java new file mode 100644 index 0000000000000..5f96fb35999d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java @@ -0,0 +1,1115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; +import com.azure.resourcemanager.machinelearning.models.CodeContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryCodeContainersClient. */ +public final class RegistryCodeContainersClientImpl implements RegistryCodeContainersClient { + /** The proxy service used to perform REST calls. */ + private final RegistryCodeContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryCodeContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryCodeContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryCodeContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryCodeContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryCodeContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CodeContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String skip, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, context)); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String codeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String codeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String codeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, codeName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String codeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, codeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName).getSyncPoller(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, context).getSyncPoller(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName) { + return beginDeleteAsync(resourceGroupName, registryName, codeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName) { + deleteAsync(resourceGroupName, registryName, codeName).block(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName, Context context) { + deleteAsync(resourceGroupName, registryName, codeName, context).block(); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String codeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String codeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String codeName) { + return getWithResponseAsync(resourceGroupName, registryName, codeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String codeName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, context).block(); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner get(String resourceGroupName, String registryName, String codeName) { + return getWithResponse(resourceGroupName, registryName, codeName, Context.NONE).getValue(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CodeContainerInner.class, + CodeContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CodeContainerInner.class, CodeContainerInner.class, context); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body).getSyncPoller(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body, context).getSyncPoller(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, body).block(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java new file mode 100644 index 0000000000000..091464b41387f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; +import com.azure.resourcemanager.machinelearning.models.CodeContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeContainers; + +public final class RegistryCodeContainersImpl implements RegistryCodeContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryCodeContainersImpl.class); + + private final RegistryCodeContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryCodeContainersImpl( + RegistryCodeContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String skip, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, skip, context); + return Utils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String codeName) { + this.serviceClient().delete(resourceGroupName, registryName, codeName); + } + + public void delete(String resourceGroupName, String registryName, String codeName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String codeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, codeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CodeContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeContainer get(String resourceGroupName, String registryName, String codeName) { + CodeContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, codeName); + if (inner != null) { + return new CodeContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public CodeContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, context); + } + + private RegistryCodeContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public CodeContainerImpl define(String name) { + return new CodeContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java new file mode 100644 index 0000000000000..7729f098b0bb2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java @@ -0,0 +1,1474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryCodeVersionsClient. */ +public final class RegistryCodeVersionsClientImpl implements RegistryCodeVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RegistryCodeVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryCodeVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryCodeVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryCodeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryCodeVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryCodeVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, + @QueryParam("$top") Integer top, + @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CodeVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String codeName, String orderBy, Integer top, String skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + orderBy, + top, + skip, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + this.client.getApiVersion(), + orderBy, + top, + skip, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String codeName, String orderBy, Integer top, String skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String codeName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String codeName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, codeName, orderBy, top, skip)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, codeName, orderBy, top, skip, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String codeName, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, codeName, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, codeName, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName, String version) { + deleteAsync(resourceGroupName, registryName, codeName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + deleteAsync(resourceGroupName, registryName, codeName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String codeName, String version) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner get(String resourceGroupName, String registryName, String codeName, String version) { + return getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CodeVersionInner.class, + CodeVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CodeVersionInner.class, CodeVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner createOrUpdate( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String codeName, + String version, + CodeVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, + String registryName, + String codeName, + String version, + PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + codeName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, codeName, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String codeName, + String version, + PendingUploadRequestDto body, + Context context) { + return createOrGetStartPendingUploadWithResponseAsync( + resourceGroupName, registryName, codeName, version, body, context) + .block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, codeName, version, body, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java new file mode 100644 index 0000000000000..68360a3efcdb4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersion; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeVersions; + +public final class RegistryCodeVersionsImpl implements RegistryCodeVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryCodeVersionsImpl.class); + + private final RegistryCodeVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryCodeVersionsImpl( + RegistryCodeVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String codeName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, codeName); + return Utils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, codeName, orderBy, top, skip, context); + return Utils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String codeName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, version); + } + + public void delete( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String codeName, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, codeName, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CodeVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeVersion get(String resourceGroupName, String registryName, String codeName, String version) { + CodeVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, codeName, version); + if (inner != null) { + return new CodeVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String codeName, + String version, + PendingUploadRequestDto body, + Context context) { + Response inner = + this + .serviceClient() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, codeName, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = + this + .serviceClient() + .createOrGetStartPendingUpload(resourceGroupName, registryName, codeName, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public CodeVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = Utils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, version, context); + } + + private RegistryCodeVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public CodeVersionImpl define(String name) { + return new CodeVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java new file mode 100644 index 0000000000000..d1f7e611f9ab0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java @@ -0,0 +1,1144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ComponentContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryComponentContainersClient. */ +public final class RegistryComponentContainersClientImpl implements RegistryComponentContainersClient { + /** The proxy service used to perform REST calls. */ + private final RegistryComponentContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryComponentContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryComponentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + RegistryComponentContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryComponentContainers to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryComponentContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ComponentContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String skip, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String componentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String componentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String componentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, componentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String componentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, componentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String componentName) { + return beginDeleteAsync(resourceGroupName, registryName, componentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String componentName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName) { + deleteAsync(resourceGroupName, registryName, componentName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName, Context context) { + deleteAsync(resourceGroupName, registryName, componentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String componentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String componentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String componentName) { + return getWithResponseAsync(resourceGroupName, registryName, componentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String componentName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner get(String resourceGroupName, String registryName, String componentName) { + return getWithResponse(resourceGroupName, registryName, componentName, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ComponentContainerInner.class, + ComponentContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ComponentContainerInner.class, + ComponentContainerInner.class, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body, context) + .getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner createOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + ComponentContainerInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java new file mode 100644 index 0000000000000..120a987a7c4e8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ComponentContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentContainers; + +public final class RegistryComponentContainersImpl implements RegistryComponentContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryComponentContainersImpl.class); + + private final RegistryComponentContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryComponentContainersImpl( + RegistryComponentContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String skip, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, skip, context); + return Utils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String componentName) { + this.serviceClient().delete(resourceGroupName, registryName, componentName); + } + + public void delete(String resourceGroupName, String registryName, String componentName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String componentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, componentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ComponentContainer get(String resourceGroupName, String registryName, String componentName) { + ComponentContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, componentName); + if (inner != null) { + return new ComponentContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ComponentContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, context); + } + + private RegistryComponentContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ComponentContainerImpl define(String name) { + return new ComponentContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java new file mode 100644 index 0000000000000..d9c412dd98206 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java @@ -0,0 +1,1308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryComponentVersionsClient. */ +public final class RegistryComponentVersionsClientImpl implements RegistryComponentVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RegistryComponentVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryComponentVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryComponentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + RegistryComponentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryComponentVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryComponentVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, + @QueryParam("$top") Integer top, + @QueryParam("$skip") String skip, + @QueryParam("stage") String stage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ComponentVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + orderBy, + top, + skip, + stage, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + this.client.getApiVersion(), + orderBy, + top, + skip, + stage, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String componentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String stage = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, stage, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String componentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String stage = null; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, stage, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String componentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String componentName, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, componentName, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, componentName, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String componentName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName, String version) { + deleteAsync(resourceGroupName, registryName, componentName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + deleteAsync(resourceGroupName, registryName, componentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String componentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String componentName, String version) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner get( + String resourceGroupName, String registryName, String componentName, String version) { + return getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + componentName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ComponentVersionInner.class, + ComponentVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ComponentVersionInner.class, ComponentVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String componentName, + String version, + ComponentVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java new file mode 100644 index 0000000000000..7054fbbf5d78f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ComponentVersion; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentVersions; + +public final class RegistryComponentVersionsImpl implements RegistryComponentVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryComponentVersionsImpl.class); + + private final RegistryComponentVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryComponentVersionsImpl( + RegistryComponentVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String componentName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, componentName); + return Utils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, registryName, componentName, orderBy, top, skip, stage, context); + return Utils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String componentName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, version); + } + + public void delete( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String componentName, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, componentName, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComponentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ComponentVersion get(String resourceGroupName, String registryName, String componentName, String version) { + ComponentVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, componentName, version); + if (inner != null) { + return new ComponentVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ComponentVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = Utils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, version, context); + } + + private RegistryComponentVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ComponentVersionImpl define(String name) { + return new ComponentVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java new file mode 100644 index 0000000000000..0fff347f42a76 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java @@ -0,0 +1,1125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.DataContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryDataContainersClient. */ +public final class RegistryDataContainersClientImpl implements RegistryDataContainersClient { + /** The proxy service used to perform REST calls. */ + private final RegistryDataContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryDataContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryDataContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryDataContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryDataContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryDataContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name) { + return this.beginDeleteAsync(resourceGroupName, registryName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name) { + return beginDeleteAsync(resourceGroupName, registryName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name) { + deleteAsync(resourceGroupName, registryName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, Context context) { + deleteAsync(resourceGroupName, registryName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String name) { + return getWithResponseAsync(resourceGroupName, registryName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner get(String resourceGroupName, String registryName, String name) { + return getWithResponse(resourceGroupName, registryName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataContainerInner.class, + DataContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataContainerInner.class, DataContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner createOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner createOrUpdate( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java new file mode 100644 index 0000000000000..2de0d01b6ca62 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.DataContainer; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryDataContainers; + +public final class RegistryDataContainersImpl implements RegistryDataContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryDataContainersImpl.class); + + private final RegistryDataContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryDataContainersImpl( + RegistryDataContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return Utils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String name) { + this.serviceClient().delete(resourceGroupName, registryName, name); + } + + public void delete(String resourceGroupName, String registryName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, name, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataContainer get(String resourceGroupName, String registryName, String name) { + DataContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, name); + if (inner != null) { + return new DataContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + this.delete(resourceGroupName, registryName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + this.delete(resourceGroupName, registryName, name, context); + } + + private RegistryDataContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public DataContainerImpl define(String name) { + return new DataContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java new file mode 100644 index 0000000000000..2d97e4789520b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java @@ -0,0 +1,1527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.DataVersionBaseResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryDataVersionsClient. */ +public final class RegistryDataVersionsClientImpl implements RegistryDataVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RegistryDataVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryDataVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryDataVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryDataVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryDataVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryDataVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, + @QueryParam("$top") Integer top, + @QueryParam("$skip") String skip, + @QueryParam("$tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataVersionBaseInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + orderBy, + top, + skip, + tags, + listViewType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + this.client.getApiVersion(), + orderBy, + top, + skip, + tags, + listViewType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String name) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String name) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String name, String version) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, name, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String name, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name, String version) { + return beginDeleteAsync(resourceGroupName, registryName, name, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String name, String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, name, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, String version) { + deleteAsync(resourceGroupName, registryName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, String version, Context context) { + deleteAsync(resourceGroupName, registryName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String name, String version) { + return getWithResponseAsync(resourceGroupName, registryName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String name, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner get(String resourceGroupName, String registryName, String name, String version) { + return getWithResponse(resourceGroupName, registryName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataVersionBaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataVersionBaseInner.class, + DataVersionBaseInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataVersionBaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataVersionBaseInner.class, DataVersionBaseInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner createOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner createOrUpdate( + String resourceGroupName, + String registryName, + String name, + String version, + DataVersionBaseInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, name, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, + String registryName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + name, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, name, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + return createOrGetStartPendingUploadWithResponseAsync( + resourceGroupName, registryName, name, version, body, context) + .block(); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, name, version, body, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java new file mode 100644 index 0000000000000..51cff7e52b8aa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.DataVersionBase; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryDataVersions; + +public final class RegistryDataVersionsImpl implements RegistryDataVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryDataVersionsImpl.class); + + private final RegistryDataVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryDataVersionsImpl( + RegistryDataVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, name); + return Utils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType, context); + return Utils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String name, String version) { + this.serviceClient().delete(resourceGroupName, registryName, name, version); + } + + public void delete(String resourceGroupName, String registryName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, name, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String name, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, name, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataVersionBaseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataVersionBase get(String resourceGroupName, String registryName, String name, String version) { + DataVersionBaseInner inner = this.serviceClient().get(resourceGroupName, registryName, name, version); + if (inner != null) { + return new DataVersionBaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String name, + String version, + PendingUploadRequestDto body, + Context context) { + Response inner = + this + .serviceClient() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = + this.serviceClient().createOrGetStartPendingUpload(resourceGroupName, registryName, name, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataVersionBase getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, name, version, context); + } + + private RegistryDataVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public DataVersionBaseImpl define(String name) { + return new DataVersionBaseImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java new file mode 100644 index 0000000000000..baa2dbc332e13 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java @@ -0,0 +1,1165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryEnvironmentContainersClient. */ +public final class RegistryEnvironmentContainersClientImpl implements RegistryEnvironmentContainersClient { + /** The proxy service used to perform REST calls. */ + private final RegistryEnvironmentContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryEnvironmentContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryEnvironmentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + RegistryEnvironmentContainersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryEnvironmentContainers to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryEnvironmentContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EnvironmentContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String environmentName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, environmentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String environmentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, environmentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String environmentName) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String environmentName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName) { + deleteAsync(resourceGroupName, registryName, environmentName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName, Context context) { + deleteAsync(resourceGroupName, registryName, environmentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String environmentName) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner get(String resourceGroupName, String registryName, String environmentName) { + return getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EnvironmentContainerInner.class, + EnvironmentContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EnvironmentContainerInner.class, + EnvironmentContainerInner.class, + context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context) + .getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner createOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + EnvironmentContainerInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java new file mode 100644 index 0000000000000..5a92713cac223 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentContainers; + +public final class RegistryEnvironmentContainersImpl implements RegistryEnvironmentContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryEnvironmentContainersImpl.class); + + private final RegistryEnvironmentContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryEnvironmentContainersImpl( + RegistryEnvironmentContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return Utils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String environmentName) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName); + } + + public void delete(String resourceGroupName, String registryName, String environmentName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, environmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnvironmentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EnvironmentContainer get(String resourceGroupName, String registryName, String environmentName) { + EnvironmentContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, environmentName); + if (inner != null) { + return new EnvironmentContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public EnvironmentContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, context); + } + + private RegistryEnvironmentContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public EnvironmentContainerImpl define(String name) { + return new EnvironmentContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java new file mode 100644 index 0000000000000..a0c987cbe716e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java @@ -0,0 +1,1344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryEnvironmentVersionsClient. */ +public final class RegistryEnvironmentVersionsClientImpl implements RegistryEnvironmentVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RegistryEnvironmentVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryEnvironmentVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryEnvironmentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create( + RegistryEnvironmentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryEnvironmentVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryEnvironmentVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, + @QueryParam("$top") Integer top, + @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("stage") String stage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EnvironmentVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + orderBy, + top, + skip, + listViewType, + stage, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + this.client.getApiVersion(), + orderBy, + top, + skip, + listViewType, + stage, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String environmentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final ListViewType listViewType = null; + final String stage = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String environmentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final ListViewType listViewType = null; + final String stage = null; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String environmentName, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, environmentName, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, environmentName, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + return this + .beginDeleteAsync(resourceGroupName, registryName, environmentName, version, context) + .getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String environmentName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName, String version) { + deleteAsync(resourceGroupName, registryName, environmentName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + deleteAsync(resourceGroupName, registryName, environmentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String environmentName, String version) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner get( + String resourceGroupName, String registryName, String environmentName, String version) { + return getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + environmentName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EnvironmentVersionInner.class, + EnvironmentVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, version, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EnvironmentVersionInner.class, + EnvironmentVersionInner.class, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String environmentName, + String version, + EnvironmentVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java new file mode 100644 index 0000000000000..c6026097eb04c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentVersions; + +public final class RegistryEnvironmentVersionsImpl implements RegistryEnvironmentVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryEnvironmentVersionsImpl.class); + + private final RegistryEnvironmentVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryEnvironmentVersionsImpl( + RegistryEnvironmentVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String registryName, String environmentName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, environmentName); + return Utils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage, context); + return Utils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String environmentName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, version); + } + + public void delete( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, environmentName, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnvironmentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EnvironmentVersion get( + String resourceGroupName, String registryName, String environmentName, String version) { + EnvironmentVersionInner inner = + this.serviceClient().get(resourceGroupName, registryName, environmentName, version); + if (inner != null) { + return new EnvironmentVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EnvironmentVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, version, context); + } + + private RegistryEnvironmentVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public EnvironmentVersionImpl define(String name) { + return new EnvironmentVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..612b9ae1d3c05 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RegistryImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String discoveryUrl() { + return this.innerModel().discoveryUrl(); + } + + public String intellectualPropertyPublisher() { + return this.innerModel().intellectualPropertyPublisher(); + } + + public ArmResourceId managedResourceGroup() { + return this.innerModel().managedResourceGroup(); + } + + public String mlFlowRegistryUri() { + return this.innerModel().mlFlowRegistryUri(); + } + + public List registryPrivateEndpointConnections() { + List inner = this.innerModel().registryPrivateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List regionDetails() { + List inner = this.innerModel().regionDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private PartialRegistryPartialTrackedResource updateBody; + + public RegistryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Registry create() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .createOrUpdate(resourceGroupName, registryName, this.innerModel(), Context.NONE); + return this; + } + + public Registry create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .createOrUpdate(resourceGroupName, registryName, this.innerModel(), context); + return this; + } + + RegistryImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new RegistryInner(); + this.serviceManager = serviceManager; + this.registryName = name; + } + + public RegistryImpl update() { + this.updateBody = new PartialRegistryPartialTrackedResource(); + return this; + } + + public Registry apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .updateWithResponse(resourceGroupName, registryName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Registry apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .updateWithResponse(resourceGroupName, registryName, updateBody, context) + .getValue(); + return this; + } + + RegistryImpl( + RegistryInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + } + + public Registry refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE) + .getValue(); + return this; + } + + public Registry refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, context) + .getValue(); + return this; + } + + public Registry removeRegions(RegistryInner body) { + return serviceManager.registries().removeRegions(resourceGroupName, registryName, body); + } + + public Registry removeRegions(RegistryInner body, Context context) { + return serviceManager.registries().removeRegions(resourceGroupName, registryName, body, context); + } + + public RegistryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RegistryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RegistryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public RegistryImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public RegistryImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public RegistryImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public RegistryImpl withDiscoveryUrl(String discoveryUrl) { + this.innerModel().withDiscoveryUrl(discoveryUrl); + return this; + } + + public RegistryImpl withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + this.innerModel().withIntellectualPropertyPublisher(intellectualPropertyPublisher); + return this; + } + + public RegistryImpl withManagedResourceGroup(ArmResourceId managedResourceGroup) { + this.innerModel().withManagedResourceGroup(managedResourceGroup); + return this; + } + + public RegistryImpl withMlFlowRegistryUri(String mlFlowRegistryUri) { + this.innerModel().withMlFlowRegistryUri(mlFlowRegistryUri); + return this; + } + + public RegistryImpl withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + this.innerModel().withRegistryPrivateEndpointConnections(registryPrivateEndpointConnections); + return this; + } + + public RegistryImpl withPublicNetworkAccess(String publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public RegistryImpl withRegionDetails(List regionDetails) { + this.innerModel().withRegionDetails(regionDetails); + return this; + } + + public RegistryImpl withIdentity(RegistryPartialManagedServiceIdentity identity) { + this.updateBody.withIdentity(identity); + return this; + } + + public RegistryImpl withSku(PartialSku sku) { + this.updateBody.withSku(sku); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java new file mode 100644 index 0000000000000..cd48fccc0d855 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java @@ -0,0 +1,1127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryModelContainersClient. */ +public final class RegistryModelContainersClientImpl implements RegistryModelContainersClient { + /** The proxy service used to perform REST calls. */ + private final RegistryModelContainersService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryModelContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryModelContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryModelContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryModelContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryModelContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ModelContainerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + this.client.getApiVersion(), + skip, + listViewType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String modelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String modelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String modelName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, modelName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String modelName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, modelName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName) { + return beginDeleteAsync(resourceGroupName, registryName, modelName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName) { + deleteAsync(resourceGroupName, registryName, modelName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName, Context context) { + deleteAsync(resourceGroupName, registryName, modelName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String modelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String modelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String modelName) { + return getWithResponseAsync(resourceGroupName, registryName, modelName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String modelName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner get(String resourceGroupName, String registryName, String modelName) { + return getWithResponse(resourceGroupName, registryName, modelName, Context.NONE).getValue(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ModelContainerInner.class, + ModelContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ModelContainerInner.class, ModelContainerInner.class, context); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body).getSyncPoller(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body, context).getSyncPoller(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, body).block(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java new file mode 100644 index 0000000000000..5309a813a8a58 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryModelContainers; + +public final class RegistryModelContainersImpl implements RegistryModelContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryModelContainersImpl.class); + + private final RegistryModelContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryModelContainersImpl( + RegistryModelContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return Utils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String modelName) { + this.serviceClient().delete(resourceGroupName, registryName, modelName); + } + + public void delete(String resourceGroupName, String registryName, String modelName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String modelName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, modelName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ModelContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ModelContainer get(String resourceGroupName, String registryName, String modelName) { + ModelContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, modelName); + if (inner != null) { + return new ModelContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ModelContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, context); + } + + private RegistryModelContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ModelContainerImpl define(String name) { + return new ModelContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java new file mode 100644 index 0000000000000..0ec4f4a16e9df --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java @@ -0,0 +1,1979 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistryModelVersionsClient. */ +public final class RegistryModelVersionsClientImpl implements RegistryModelVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RegistryModelVersionsService service; + + /** The service client containing this operation class. */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryModelVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryModelVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = + RestProxy + .create(RegistryModelVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryModelVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryModelVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("$orderBy") String orderBy, + @QueryParam("$top") Integer top, + @QueryParam("version") String version, + @QueryParam("description") String description, + @QueryParam("tags") String tags, + @QueryParam("properties") String properties, + @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ModelVersionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> packageMethod( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PackageRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + this.client.getApiVersion(), + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String modelName) { + final String skip = null; + final String orderBy = null; + final Integer top = null; + final String version = null; + final String description = null; + final String tags = null; + final String properties = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType, + context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String modelName) { + final String skip = null; + final String orderBy = null; + final Integer top = null; + final String version = null; + final String description = null; + final String tags = null; + final String properties = null; + final ListViewType listViewType = null; + return new PagedIterable<>( + listAsync( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType, + context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String modelName, String version) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, modelName, version); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, modelName, version, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, version) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, version, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName, String version) { + deleteAsync(resourceGroupName, registryName, modelName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + deleteAsync(resourceGroupName, registryName, modelName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String modelName, String version) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner get(String resourceGroupName, String registryName, String modelName, String version) { + return getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ModelVersionInner.class, + ModelVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ModelVersionInner.class, ModelVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner createOrUpdate( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner createOrUpdate( + String resourceGroupName, + String registryName, + String modelName, + String version, + ModelVersionInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context).block(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packageMethodWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .packageMethod( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packageMethodWithResponseAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .packageMethod( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResponseInner> beginPackageMethodAsync( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + Mono>> mono = + packageMethodWithResponseAsync(resourceGroupName, registryName, modelName, version, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PackageResponseInner.class, + PackageResponseInner.class, + this.client.getContext()); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResponseInner> beginPackageMethodAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + packageMethodWithResponseAsync(resourceGroupName, registryName, modelName, version, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PackageResponseInner.class, PackageResponseInner.class, context); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + return this.beginPackageMethodAsync(resourceGroupName, registryName, modelName, version, body).getSyncPoller(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of package response returned after async package operation completes + * successfully. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResponseInner> beginPackageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + return this + .beginPackageMethodAsync(resourceGroupName, registryName, modelName, version, body, context) + .getSyncPoller(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packageMethodAsync( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + return beginPackageMethodAsync(resourceGroupName, registryName, modelName, version, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packageMethodAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + return beginPackageMethodAsync(resourceGroupName, registryName, modelName, version, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResponseInner packageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + return packageMethodAsync(resourceGroupName, registryName, modelName, version, body).block(); + } + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResponseInner packageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + return packageMethodAsync(resourceGroupName, registryName, modelName, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, + String registryName, + String modelName, + String version, + PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrGetStartPendingUpload( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + modelName, + version, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, modelName, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String modelName, + String version, + PendingUploadRequestDto body, + Context context) { + return createOrGetStartPendingUploadWithResponseAsync( + resourceGroupName, registryName, modelName, version, body, context) + .block(); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, modelName, version, body, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java new file mode 100644 index 0000000000000..d73003963038a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersion; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import com.azure.resourcemanager.machinelearning.models.PackageResponse; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryModelVersions; + +public final class RegistryModelVersionsImpl implements RegistryModelVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryModelVersionsImpl.class); + + private final RegistryModelVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryModelVersionsImpl( + RegistryModelVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String modelName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, modelName); + return Utils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list( + resourceGroupName, + registryName, + modelName, + skip, + orderBy, + top, + version, + description, + tags, + properties, + listViewType, + context); + return Utils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String modelName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, version); + } + + public void delete( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, version, context); + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String modelName, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, modelName, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ModelVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ModelVersion get(String resourceGroupName, String registryName, String modelName, String version) { + ModelVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, modelName, version); + if (inner != null) { + return new ModelVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PackageResponse packageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body) { + PackageResponseInner inner = + this.serviceClient().packageMethod(resourceGroupName, registryName, modelName, version, body); + if (inner != null) { + return new PackageResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PackageResponse packageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context) { + PackageResponseInner inner = + this.serviceClient().packageMethod(resourceGroupName, registryName, modelName, version, body, context); + if (inner != null) { + return new PackageResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String modelName, + String version, + PendingUploadRequestDto body, + Context context) { + Response inner = + this + .serviceClient() + .createOrGetStartPendingUploadWithResponse( + resourceGroupName, registryName, modelName, version, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = + this + .serviceClient() + .createOrGetStartPendingUpload(resourceGroupName, registryName, modelName, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public ModelVersion getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = Utils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = Utils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, version, context); + } + + private RegistryModelVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ModelVersionImpl define(String name) { + return new ModelVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java index 5b592b442ec78..366d2c3779d1f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java @@ -45,30 +45,29 @@ public final class SchedulesClientImpl implements SchedulesClient { private final SchedulesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of SchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - SchedulesClientImpl(AzureMachineLearningWorkspacesImpl client) { + SchedulesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesSchedules to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesSchedules to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface SchedulesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -84,8 +83,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -100,8 +98,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -116,8 +113,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java index ec1dff04b47bb..6c487eabab2f8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java @@ -36,21 +36,21 @@ public final class UsagesClientImpl implements UsagesClient { private final UsagesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of UsagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - UsagesClientImpl(AzureMachineLearningWorkspacesImpl client) { + UsagesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesUsages to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesUsages to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java index 862150234bac0..86b5f7b8640ff 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java @@ -31,21 +31,21 @@ public final class VirtualMachineSizesClientImpl implements VirtualMachineSizesC private final VirtualMachineSizesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of VirtualMachineSizesClientImpl. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineSizesClientImpl(AzureMachineLearningWorkspacesImpl client) { + VirtualMachineSizesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesVirtualMachineSizes to be used by the + * The interface defining all the services for AzureMachineLearningServicesVirtualMachineSizes to be used by the * proxy service to perform REST calls. */ @Host("{$host}") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java index 9ff113b0e7ac1..7247ae36b6947 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java @@ -4,25 +4,22 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionUpdateParameter; public final class WorkspaceConnectionPropertiesV2BasicResourceImpl - implements WorkspaceConnectionPropertiesV2BasicResource, WorkspaceConnectionPropertiesV2BasicResource.Definition { + implements WorkspaceConnectionPropertiesV2BasicResource, + WorkspaceConnectionPropertiesV2BasicResource.Definition, + WorkspaceConnectionPropertiesV2BasicResource.Update { private WorkspaceConnectionPropertiesV2BasicResourceInner innerObject; private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - WorkspaceConnectionPropertiesV2BasicResourceImpl( - WorkspaceConnectionPropertiesV2BasicResourceInner innerObject, - com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -43,6 +40,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public String resourceGroupName() { + return resourceGroupName; + } + public WorkspaceConnectionPropertiesV2BasicResourceInner innerModel() { return this.innerObject; } @@ -57,6 +58,8 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String connectionName; + private WorkspaceConnectionUpdateParameter updateBody; + public WorkspaceConnectionPropertiesV2BasicResourceImpl withExistingWorkspace( String resourceGroupName, String workspaceName) { this.resourceGroupName = resourceGroupName; @@ -91,6 +94,41 @@ public WorkspaceConnectionPropertiesV2BasicResource create(Context context) { this.connectionName = name; } + public WorkspaceConnectionPropertiesV2BasicResourceImpl update() { + this.updateBody = new WorkspaceConnectionUpdateParameter(); + return this; + } + + public WorkspaceConnectionPropertiesV2BasicResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceConnections() + .updateWithResponse(resourceGroupName, workspaceName, connectionName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceConnectionPropertiesV2BasicResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceConnections() + .updateWithResponse(resourceGroupName, workspaceName, connectionName, updateBody, context) + .getValue(); + return this; + } + + WorkspaceConnectionPropertiesV2BasicResourceImpl( + WorkspaceConnectionPropertiesV2BasicResourceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + public WorkspaceConnectionPropertiesV2BasicResource refresh() { this.innerObject = serviceManager @@ -111,8 +149,27 @@ public WorkspaceConnectionPropertiesV2BasicResource refresh(Context context) { return this; } + public Response listSecretsWithResponse(Context context) { + return serviceManager + .workspaceConnections() + .listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, context); + } + + public WorkspaceConnectionPropertiesV2BasicResource listSecrets() { + return serviceManager.workspaceConnections().listSecrets(resourceGroupName, workspaceName, connectionName); + } + public WorkspaceConnectionPropertiesV2BasicResourceImpl withProperties(WorkspaceConnectionPropertiesV2 properties) { - this.innerModel().withProperties(properties); - return this; + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateBody.withProperties(properties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java index 2b07717ee35e0..09cc99fee6d3c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java @@ -12,7 +12,9 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -31,6 +33,7 @@ import com.azure.resourcemanager.machinelearning.fluent.WorkspaceConnectionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionUpdateParameter; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. */ @@ -39,14 +42,14 @@ public final class WorkspaceConnectionsClientImpl implements WorkspaceConnection private final WorkspaceConnectionsService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspaceConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - WorkspaceConnectionsClientImpl(AzureMachineLearningWorkspacesImpl client) { + WorkspaceConnectionsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy .create(WorkspaceConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -54,33 +57,46 @@ public final class WorkspaceConnectionsClientImpl implements WorkspaceConnection } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaceConnections to be used by the + * The interface defining all the services for AzureMachineLearningServicesWorkspaceConnections to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspaceConnectionsService { @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("target") String target, + @QueryParam("category") String category, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkspaceConnectionPropertiesV2BasicResourceInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -94,34 +110,48 @@ Mono> get( Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") - @ExpectedResponses({200, 204}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkspaceConnectionUpdateParameter body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> create( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @QueryParam("target") String target, - @QueryParam("category") String category, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkspaceConnectionPropertiesV2BasicResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSecrets( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -138,23 +168,391 @@ Mono> l } /** - * The create operation. + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String target, String category) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + target, + category, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String target, String category, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + target, + category, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String target, String category) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName) { + final String target = null; + final String category = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String target, String category, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName) { + final String target = null; + final String category = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category)); + } + + /** + * Lists all the available machine learning workspaces connections under the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String target, String category, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category, context)); + } + + /** + * Delete machine learning workspaces connections by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + connectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete machine learning workspaces connections by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + connectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete machine learning workspaces connections by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String connectionName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, connectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete machine learning workspaces connections by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); + } + + /** + * Delete machine learning workspaces connections by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String connectionName) { + deleteWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE); + } + + /** + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -177,36 +575,29 @@ private Mono> create if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .create( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), - parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The create operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -214,12 +605,8 @@ private Mono> create * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, - Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -242,55 +629,44 @@ private Mono> create if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( + .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), - parameters, accept, context); } /** - * The create operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { - return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, parameters) + private Mono getAsync( + String resourceGroupName, String workspaceName, String connectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, connectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The create operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -298,51 +674,46 @@ private Mono createAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, - Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, parameters, context).block(); + public Response getWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); } /** - * The create operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. - * @param parameters The object for creating or updating a new workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceConnectionPropertiesV2BasicResourceInner create( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { - return createWithResponse(resourceGroupName, workspaceName, connectionName, parameters, Context.NONE) - .getValue(); + public WorkspaceConnectionPropertiesV2BasicResourceInner get( + String resourceGroupName, String workspaceName, String connectionName) { + return getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); } /** - * The get operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body Parameters for workspace connection update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName) { + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionUpdateParameter body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -365,29 +736,34 @@ private Mono> getWit if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The get operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body Parameters for workspace connection update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -395,8 +771,12 @@ private Mono> getWit * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionUpdateParameter body, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -419,22 +799,26 @@ private Mono> getWit if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .update( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), + body, accept, context); } /** - * The get operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -445,18 +829,20 @@ private Mono> getWit * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( + private Mono updateAsync( String resourceGroupName, String workspaceName, String connectionName) { - return getWithResponseAsync(resourceGroupName, workspaceName, connectionName) + final WorkspaceConnectionUpdateParameter body = null; + return updateWithResponseAsync(resourceGroupName, workspaceName, connectionName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The get operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body Parameters for workspace connection update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -464,13 +850,17 @@ private Mono getAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionUpdateParameter body, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, connectionName, body, context).block(); } /** - * The get operation. + * Update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -481,25 +871,30 @@ public Response getWithRespon * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceConnectionPropertiesV2BasicResourceInner get( + public WorkspaceConnectionPropertiesV2BasicResourceInner update( String resourceGroupName, String workspaceName, String connectionName) { - return getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); + final WorkspaceConnectionUpdateParameter body = null; + return updateWithResponse(resourceGroupName, workspaceName, connectionName, body, Context.NONE).getValue(); } /** - * The delete operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body The object for creating or updating a new workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName) { + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionPropertiesV2BasicResourceInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -522,38 +917,47 @@ private Mono> deleteWithResponseAsync( if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .create( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The delete operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body The object for creating or updating a new workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionPropertiesV2BasicResourceInner body, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -576,22 +980,26 @@ private Mono> deleteWithResponseAsync( if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .create( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), + body, accept, context); } /** - * The delete operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -599,34 +1007,41 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String connectionName) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, connectionName) - .flatMap(ignored -> Mono.empty()); + private Mono createAsync( + String resourceGroupName, String workspaceName, String connectionName) { + final WorkspaceConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The delete operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. + * @param body The object for creating or updating a new workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String connectionName, + WorkspaceConnectionPropertiesV2BasicResourceInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, body, context).block(); } /** - * The delete operation. + * Create or update machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -634,27 +1049,29 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String connectionName) { - deleteWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE); + public WorkspaceConnectionPropertiesV2BasicResourceInner create( + String resourceGroupName, String workspaceName, String connectionName) { + final WorkspaceConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponse(resourceGroupName, workspaceName, connectionName, body, Context.NONE).getValue(); } /** - * The list operation. + * List all the secrets of a machine learning workspaces connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. + * @param connectionName Friendly name of the workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String target, String category) { + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -674,49 +1091,41 @@ private Mono> l if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .listSecrets( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - target, - category, + connectionName, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The list operation. + * List all the secrets of a machine learning workspaces connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. + * @param connectionName Friendly name of the workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String target, String category, Context context) { + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -736,126 +1145,74 @@ private Mono> l if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .listSecrets( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - target, - category, + connectionName, this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The list operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String target, String category) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), - nextLink -> listNextSinglePageAsync(nextLink)); + context); } /** - * The list operation. + * List all the secrets of a machine learning workspaces connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return the response body on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName) { - final String target = null; - final String category = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String workspaceName, String connectionName) { + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The list operation. + * List all the secrets of a machine learning workspaces connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. + * @param connectionName Friendly name of the workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String target, String category, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The list operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName) { - final String target = null; - final String category = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); } /** - * The list operation. + * List all the secrets of a machine learning workspaces connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. - * @param context The context to associate with this operation. + * @param connectionName Friendly name of the workspace connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceConnectionPropertiesV2BasicResourceInner listSecrets( + String resourceGroupName, String workspaceName, String connectionName) { + return listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); } /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java index ba28d102dd9c4..b3b461b9a776b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java @@ -28,6 +28,31 @@ public WorkspaceConnectionsImpl( this.serviceManager = serviceManager; } + public PagedIterable list( + String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils + .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String target, String category, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, target, category, context); + return Utils + .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, connectionName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String connectionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, connectionName); + } + public Response getWithResponse( String resourceGroupName, String workspaceName, String connectionName, Context context) { Response inner = @@ -54,29 +79,30 @@ public WorkspaceConnectionPropertiesV2BasicResource get( } } - public Response deleteWithResponse( + public Response listSecretsWithResponse( String resourceGroupName, String workspaceName, String connectionName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, connectionName, context); - } - - public void delete(String resourceGroupName, String workspaceName, String connectionName) { - this.serviceClient().delete(resourceGroupName, workspaceName, connectionName); - } - - public PagedIterable list( - String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName); - return Utils - .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, target, category, context); - return Utils - .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + public WorkspaceConnectionPropertiesV2BasicResource listSecrets( + String resourceGroupName, String workspaceName, String connectionName) { + WorkspaceConnectionPropertiesV2BasicResourceInner inner = + this.serviceClient().listSecrets(resourceGroupName, workspaceName, connectionName); + if (inner != null) { + return new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } } public WorkspaceConnectionPropertiesV2BasicResource getById(String id) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java index 46e72e570fe95..4cfb7863f6890 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java @@ -36,30 +36,29 @@ public final class WorkspaceFeaturesClientImpl implements WorkspaceFeaturesClien private final WorkspaceFeaturesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspaceFeaturesClientImpl. * * @param client the instance of the service client containing this operation class. */ - WorkspaceFeaturesClientImpl(AzureMachineLearningWorkspacesImpl client) { + WorkspaceFeaturesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(WorkspaceFeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaceFeatures to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesWorkspaceFeatures to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspaceFeaturesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java index 5a2da698968a9..7efd70e3e778b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java @@ -8,26 +8,31 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseResponseResult; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ListNotebookKeysResult; import com.azure.resourcemanager.machinelearning.models.ListStorageAccountKeysResult; import com.azure.resourcemanager.machinelearning.models.ListWorkspaceKeysResult; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.NotebookAccessTokenResult; import com.azure.resourcemanager.machinelearning.models.NotebookResourceInfo; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.Sku; import com.azure.resourcemanager.machinelearning.models.Workspace; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import java.util.Collections; import java.util.List; import java.util.Map; @@ -54,10 +59,18 @@ public ManagedServiceIdentity identity() { return this.innerModel().identity(); } + public String kind() { + return this.innerModel().kind(); + } + public String location() { return this.innerModel().location(); } + public Sku sku() { + return this.innerModel().sku(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { @@ -67,76 +80,122 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); - } - public SystemData systemData() { return this.innerModel().systemData(); } - public String workspaceId() { - return this.innerModel().workspaceId(); - } - - public String description() { - return this.innerModel().description(); + public Boolean allowPublicAccessWhenBehindVnet() { + return this.innerModel().allowPublicAccessWhenBehindVnet(); } - public String friendlyName() { - return this.innerModel().friendlyName(); + public String applicationInsights() { + return this.innerModel().applicationInsights(); } - public String keyVault() { - return this.innerModel().keyVault(); + public List associatedWorkspaces() { + List inner = this.innerModel().associatedWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public String applicationInsights() { - return this.innerModel().applicationInsights(); + public List containerRegistries() { + List inner = this.innerModel().containerRegistries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } public String containerRegistry() { return this.innerModel().containerRegistry(); } - public String storageAccount() { - return this.innerModel().storageAccount(); + public String description() { + return this.innerModel().description(); } public String discoveryUrl() { return this.innerModel().discoveryUrl(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); } public EncryptionProperty encryption() { return this.innerModel().encryption(); } - public Boolean hbiWorkspace() { - return this.innerModel().hbiWorkspace(); + public List existingWorkspaces() { + List inner = this.innerModel().existingWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public String serviceProvisionedResourceGroup() { - return this.innerModel().serviceProvisionedResourceGroup(); + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); } - public Integer privateLinkCount() { - return this.innerModel().privateLinkCount(); + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public Boolean hbiWorkspace() { + return this.innerModel().hbiWorkspace(); + } + + public String hubResourceId() { + return this.innerModel().hubResourceId(); } public String imageBuildCompute() { return this.innerModel().imageBuildCompute(); } - public Boolean allowPublicAccessWhenBehindVnet() { - return this.innerModel().allowPublicAccessWhenBehindVnet(); + public String keyVault() { + return this.innerModel().keyVault(); } - public PublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); + public List keyVaults() { + List inner = this.innerModel().keyVaults(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public String mlFlowTrackingUri() { + return this.innerModel().mlFlowTrackingUri(); + } + + public NotebookResourceInfo notebookInfo() { + NotebookResourceInfoInner inner = this.innerModel().notebookInfo(); + if (inner != null) { + return new NotebookResourceInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); } public List privateEndpointConnections() { @@ -153,6 +212,26 @@ public List privateEndpointConnections() { } } + public Integer privateLinkCount() { + return this.innerModel().privateLinkCount(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public String serviceProvisionedResourceGroup() { + return this.innerModel().serviceProvisionedResourceGroup(); + } + public List sharedPrivateLinkResources() { List inner = this.innerModel().sharedPrivateLinkResources(); if (inner != null) { @@ -162,37 +241,45 @@ public List sharedPrivateLinkResources() { } } - public NotebookResourceInfo notebookInfo() { - NotebookResourceInfoInner inner = this.innerModel().notebookInfo(); + public Integer softDeleteRetentionInDays() { + return this.innerModel().softDeleteRetentionInDays(); + } + + public String storageAccount() { + return this.innerModel().storageAccount(); + } + + public List storageAccounts() { + List inner = this.innerModel().storageAccounts(); if (inner != null) { - return new NotebookResourceInfoImpl(inner, this.manager()); + return Collections.unmodifiableList(inner); } else { - return null; + return Collections.emptyList(); } } - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.innerModel().serviceManagedResourcesSettings(); + public Boolean storageHnsEnabled() { + return this.innerModel().storageHnsEnabled(); } - public String primaryUserAssignedIdentity() { - return this.innerModel().primaryUserAssignedIdentity(); + public String systemDatastoresAuthMode() { + return this.innerModel().systemDatastoresAuthMode(); } public String tenantId() { return this.innerModel().tenantId(); } - public Boolean storageHnsEnabled() { - return this.innerModel().storageHnsEnabled(); + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); } - public String mlFlowTrackingUri() { - return this.innerModel().mlFlowTrackingUri(); + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerModel().workspaceHubConfig(); } - public Boolean v1LegacyMode() { - return this.innerModel().v1LegacyMode(); + public String workspaceId() { + return this.innerModel().workspaceId(); } public Region region() { @@ -219,7 +306,7 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String workspaceName; - private WorkspaceUpdateParameters updateParameters; + private WorkspaceUpdateParametersInner updateBody; public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -251,7 +338,7 @@ public Workspace create(Context context) { } public WorkspaceImpl update() { - this.updateParameters = new WorkspaceUpdateParameters(); + this.updateBody = new WorkspaceUpdateParametersInner(); return this; } @@ -260,7 +347,7 @@ public Workspace apply() { serviceManager .serviceClient() .getWorkspaces() - .update(resourceGroupName, workspaceName, updateParameters, Context.NONE); + .update(resourceGroupName, workspaceName, updateBody, Context.NONE); return this; } @@ -269,7 +356,7 @@ public Workspace apply(Context context) { serviceManager .serviceClient() .getWorkspaces() - .update(resourceGroupName, workspaceName, updateParameters, context); + .update(resourceGroupName, workspaceName, updateBody, context); return this; } @@ -305,8 +392,8 @@ public DiagnoseResponseResult diagnose() { return serviceManager.workspaces().diagnose(resourceGroupName, workspaceName); } - public DiagnoseResponseResult diagnose(DiagnoseWorkspaceParameters parameters, Context context) { - return serviceManager.workspaces().diagnose(resourceGroupName, workspaceName, parameters, context); + public DiagnoseResponseResult diagnose(DiagnoseWorkspaceParameters body, Context context) { + return serviceManager.workspaces().diagnose(resourceGroupName, workspaceName, body, context); } public Response listKeysWithResponse(Context context) { @@ -317,14 +404,6 @@ public ListWorkspaceKeysResult listKeys() { return serviceManager.workspaces().listKeys(resourceGroupName, workspaceName); } - public void resyncKeys() { - serviceManager.workspaces().resyncKeys(resourceGroupName, workspaceName); - } - - public void resyncKeys(Context context) { - serviceManager.workspaces().resyncKeys(resourceGroupName, workspaceName, context); - } - public Response listNotebookAccessTokenWithResponse(Context context) { return serviceManager .workspaces() @@ -335,12 +414,12 @@ public NotebookAccessTokenResult listNotebookAccessToken() { return serviceManager.workspaces().listNotebookAccessToken(resourceGroupName, workspaceName); } - public NotebookResourceInfo prepareNotebook() { - return serviceManager.workspaces().prepareNotebook(resourceGroupName, workspaceName); + public Response listNotebookKeysWithResponse(Context context) { + return serviceManager.workspaces().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); } - public NotebookResourceInfo prepareNotebook(Context context) { - return serviceManager.workspaces().prepareNotebook(resourceGroupName, workspaceName, context); + public ListNotebookKeysResult listNotebookKeys() { + return serviceManager.workspaces().listNotebookKeys(resourceGroupName, workspaceName); } public Response listStorageAccountKeysWithResponse(Context context) { @@ -353,12 +432,20 @@ public ListStorageAccountKeysResult listStorageAccountKeys() { return serviceManager.workspaces().listStorageAccountKeys(resourceGroupName, workspaceName); } - public Response listNotebookKeysWithResponse(Context context) { - return serviceManager.workspaces().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); + public NotebookResourceInfo prepareNotebook() { + return serviceManager.workspaces().prepareNotebook(resourceGroupName, workspaceName); } - public ListNotebookKeysResult listNotebookKeys() { - return serviceManager.workspaces().listNotebookKeys(resourceGroupName, workspaceName); + public NotebookResourceInfo prepareNotebook(Context context) { + return serviceManager.workspaces().prepareNotebook(resourceGroupName, workspaceName, context); + } + + public void resyncKeys() { + serviceManager.workspaces().resyncKeys(resourceGroupName, workspaceName); + } + + public void resyncKeys(Context context) { + serviceManager.workspaces().resyncKeys(resourceGroupName, workspaceName, context); } public WorkspaceImpl withRegion(Region location) { @@ -376,7 +463,7 @@ public WorkspaceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateParameters.withTags(tags); + this.updateBody.withTags(tags); return this; } } @@ -386,17 +473,57 @@ public WorkspaceImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } else { - this.updateParameters.withIdentity(identity); + this.updateBody.withIdentity(identity); return this; } } + public WorkspaceImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + public WorkspaceImpl withSku(Sku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); return this; } else { - this.updateParameters.withSku(sku); + this.updateBody.withSku(sku); + return this; + } + } + + public WorkspaceImpl withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { + this.innerModel().withAllowPublicAccessWhenBehindVnet(allowPublicAccessWhenBehindVnet); + return this; + } + + public WorkspaceImpl withApplicationInsights(String applicationInsights) { + if (isInCreateMode()) { + this.innerModel().withApplicationInsights(applicationInsights); + return this; + } else { + this.updateBody.withApplicationInsights(applicationInsights); + return this; + } + } + + public WorkspaceImpl withAssociatedWorkspaces(List associatedWorkspaces) { + this.innerModel().withAssociatedWorkspaces(associatedWorkspaces); + return this; + } + + public WorkspaceImpl withContainerRegistries(List containerRegistries) { + this.innerModel().withContainerRegistries(containerRegistries); + return this; + } + + public WorkspaceImpl withContainerRegistry(String containerRegistry) { + if (isInCreateMode()) { + this.innerModel().withContainerRegistry(containerRegistry); + return this; + } else { + this.updateBody.withContainerRegistry(containerRegistry); return this; } } @@ -406,87 +533,123 @@ public WorkspaceImpl withDescription(String description) { this.innerModel().withDescription(description); return this; } else { - this.updateParameters.withDescription(description); + this.updateBody.withDescription(description); return this; } } - public WorkspaceImpl withFriendlyName(String friendlyName) { + public WorkspaceImpl withDiscoveryUrl(String discoveryUrl) { + this.innerModel().withDiscoveryUrl(discoveryUrl); + return this; + } + + public WorkspaceImpl withEnableDataIsolation(Boolean enableDataIsolation) { if (isInCreateMode()) { - this.innerModel().withFriendlyName(friendlyName); + this.innerModel().withEnableDataIsolation(enableDataIsolation); return this; } else { - this.updateParameters.withFriendlyName(friendlyName); + this.updateBody.withEnableDataIsolation(enableDataIsolation); return this; } } - public WorkspaceImpl withKeyVault(String keyVault) { - this.innerModel().withKeyVault(keyVault); + public WorkspaceImpl withEncryption(EncryptionProperty encryption) { + this.innerModel().withEncryption(encryption); return this; } - public WorkspaceImpl withApplicationInsights(String applicationInsights) { + public WorkspaceImpl withExistingWorkspaces(List existingWorkspaces) { + this.innerModel().withExistingWorkspaces(existingWorkspaces); + return this; + } + + public WorkspaceImpl withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { if (isInCreateMode()) { - this.innerModel().withApplicationInsights(applicationInsights); + this.innerModel().withFeatureStoreSettings(featureStoreSettings); return this; } else { - this.updateParameters.withApplicationInsights(applicationInsights); + this.updateBody.withFeatureStoreSettings(featureStoreSettings); return this; } } - public WorkspaceImpl withContainerRegistry(String containerRegistry) { + public WorkspaceImpl withFriendlyName(String friendlyName) { if (isInCreateMode()) { - this.innerModel().withContainerRegistry(containerRegistry); + this.innerModel().withFriendlyName(friendlyName); return this; } else { - this.updateParameters.withContainerRegistry(containerRegistry); + this.updateBody.withFriendlyName(friendlyName); return this; } } - public WorkspaceImpl withStorageAccount(String storageAccount) { - this.innerModel().withStorageAccount(storageAccount); + public WorkspaceImpl withHbiWorkspace(Boolean hbiWorkspace) { + this.innerModel().withHbiWorkspace(hbiWorkspace); return this; } - public WorkspaceImpl withDiscoveryUrl(String discoveryUrl) { - this.innerModel().withDiscoveryUrl(discoveryUrl); + public WorkspaceImpl withHubResourceId(String hubResourceId) { + this.innerModel().withHubResourceId(hubResourceId); return this; } - public WorkspaceImpl withEncryption(EncryptionProperty encryption) { - this.innerModel().withEncryption(encryption); + public WorkspaceImpl withImageBuildCompute(String imageBuildCompute) { + if (isInCreateMode()) { + this.innerModel().withImageBuildCompute(imageBuildCompute); + return this; + } else { + this.updateBody.withImageBuildCompute(imageBuildCompute); + return this; + } + } + + public WorkspaceImpl withKeyVault(String keyVault) { + this.innerModel().withKeyVault(keyVault); return this; } - public WorkspaceImpl withHbiWorkspace(Boolean hbiWorkspace) { - this.innerModel().withHbiWorkspace(hbiWorkspace); + public WorkspaceImpl withKeyVaults(List keyVaults) { + this.innerModel().withKeyVaults(keyVaults); return this; } - public WorkspaceImpl withImageBuildCompute(String imageBuildCompute) { + public WorkspaceImpl withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { if (isInCreateMode()) { - this.innerModel().withImageBuildCompute(imageBuildCompute); + this.innerModel().withManagedNetwork(managedNetwork); return this; } else { - this.updateParameters.withImageBuildCompute(imageBuildCompute); + this.updateBody.withManagedNetwork(managedNetwork); return this; } } - public WorkspaceImpl withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) { - this.innerModel().withAllowPublicAccessWhenBehindVnet(allowPublicAccessWhenBehindVnet); - return this; + public WorkspaceImpl withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + if (isInCreateMode()) { + this.innerModel().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + return this; + } else { + this.updateBody.withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + return this; + } } - public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { if (isInCreateMode()) { this.innerModel().withPublicNetworkAccess(publicNetworkAccess); return this; } else { - this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + this.updateBody.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public WorkspaceImpl withServiceManagedResourcesSettings( + ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + if (isInCreateMode()) { + this.innerModel().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); + return this; + } else { + this.updateBody.withServiceManagedResourcesSettings(serviceManagedResourcesSettings); return this; } } @@ -496,29 +659,48 @@ public WorkspaceImpl withSharedPrivateLinkResources(List storageAccounts) { + this.innerModel().withStorageAccounts(storageAccounts); + return this; + } + + public WorkspaceImpl withSystemDatastoresAuthMode(String systemDatastoresAuthMode) { + this.innerModel().withSystemDatastoresAuthMode(systemDatastoresAuthMode); + return this; + } + + public WorkspaceImpl withV1LegacyMode(Boolean v1LegacyMode) { if (isInCreateMode()) { - this.innerModel().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + this.innerModel().withV1LegacyMode(v1LegacyMode); return this; } else { - this.updateParameters.withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + this.updateBody.withV1LegacyMode(v1LegacyMode); return this; } } - public WorkspaceImpl withV1LegacyMode(Boolean v1LegacyMode) { - this.innerModel().withV1LegacyMode(v1LegacyMode); + public WorkspaceImpl withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + this.innerModel().withWorkspaceHubConfig(workspaceHubConfig); + return this; + } + + public WorkspaceImpl withEncryption(EncryptionUpdateProperties encryption) { + this.updateBody.withEncryption(encryption); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java index e097ac2af75b8..d7674f16c2f1f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java @@ -4,16 +4,20 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesInner; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; import com.azure.resourcemanager.machinelearning.models.NotebookResourceInfo; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import com.azure.resourcemanager.machinelearning.models.WorkspaceProperties; import java.util.Collections; import java.util.List; @@ -31,68 +35,118 @@ public final class WorkspacePropertiesImpl implements WorkspaceProperties { this.serviceManager = serviceManager; } - public String workspaceId() { - return this.innerModel().workspaceId(); - } - - public String description() { - return this.innerModel().description(); + public Boolean allowPublicAccessWhenBehindVnet() { + return this.innerModel().allowPublicAccessWhenBehindVnet(); } - public String friendlyName() { - return this.innerModel().friendlyName(); + public String applicationInsights() { + return this.innerModel().applicationInsights(); } - public String keyVault() { - return this.innerModel().keyVault(); + public List associatedWorkspaces() { + List inner = this.innerModel().associatedWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public String applicationInsights() { - return this.innerModel().applicationInsights(); + public List containerRegistries() { + List inner = this.innerModel().containerRegistries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } public String containerRegistry() { return this.innerModel().containerRegistry(); } - public String storageAccount() { - return this.innerModel().storageAccount(); + public String description() { + return this.innerModel().description(); } public String discoveryUrl() { return this.innerModel().discoveryUrl(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); } public EncryptionProperty encryption() { return this.innerModel().encryption(); } - public Boolean hbiWorkspace() { - return this.innerModel().hbiWorkspace(); + public List existingWorkspaces() { + List inner = this.innerModel().existingWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public String serviceProvisionedResourceGroup() { - return this.innerModel().serviceProvisionedResourceGroup(); + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); } - public Integer privateLinkCount() { - return this.innerModel().privateLinkCount(); + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public Boolean hbiWorkspace() { + return this.innerModel().hbiWorkspace(); + } + + public String hubResourceId() { + return this.innerModel().hubResourceId(); } public String imageBuildCompute() { return this.innerModel().imageBuildCompute(); } - public Boolean allowPublicAccessWhenBehindVnet() { - return this.innerModel().allowPublicAccessWhenBehindVnet(); + public String keyVault() { + return this.innerModel().keyVault(); } - public PublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); + public List keyVaults() { + List inner = this.innerModel().keyVaults(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public String mlFlowTrackingUri() { + return this.innerModel().mlFlowTrackingUri(); + } + + public NotebookResourceInfo notebookInfo() { + NotebookResourceInfoInner inner = this.innerModel().notebookInfo(); + if (inner != null) { + return new NotebookResourceInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); } public List privateEndpointConnections() { @@ -109,6 +163,26 @@ public List privateEndpointConnections() { } } + public Integer privateLinkCount() { + return this.innerModel().privateLinkCount(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public String serviceProvisionedResourceGroup() { + return this.innerModel().serviceProvisionedResourceGroup(); + } + public List sharedPrivateLinkResources() { List inner = this.innerModel().sharedPrivateLinkResources(); if (inner != null) { @@ -118,37 +192,45 @@ public List sharedPrivateLinkResources() { } } - public NotebookResourceInfo notebookInfo() { - NotebookResourceInfoInner inner = this.innerModel().notebookInfo(); + public Integer softDeleteRetentionInDays() { + return this.innerModel().softDeleteRetentionInDays(); + } + + public String storageAccount() { + return this.innerModel().storageAccount(); + } + + public List storageAccounts() { + List inner = this.innerModel().storageAccounts(); if (inner != null) { - return new NotebookResourceInfoImpl(inner, this.manager()); + return Collections.unmodifiableList(inner); } else { - return null; + return Collections.emptyList(); } } - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.innerModel().serviceManagedResourcesSettings(); + public Boolean storageHnsEnabled() { + return this.innerModel().storageHnsEnabled(); } - public String primaryUserAssignedIdentity() { - return this.innerModel().primaryUserAssignedIdentity(); + public String systemDatastoresAuthMode() { + return this.innerModel().systemDatastoresAuthMode(); } public String tenantId() { return this.innerModel().tenantId(); } - public Boolean storageHnsEnabled() { - return this.innerModel().storageHnsEnabled(); + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); } - public String mlFlowTrackingUri() { - return this.innerModel().mlFlowTrackingUri(); + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerModel().workspaceHubConfig(); } - public Boolean v1LegacyMode() { - return this.innerModel().v1LegacyMode(); + public String workspaceId() { + return this.innerModel().workspaceId(); } public WorkspacePropertiesInner innerModel() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java new file mode 100644 index 0000000000000..555c9f1f4f625 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.WorkspacePropertiesUpdateParameters; + +public final class WorkspacePropertiesUpdateParametersImpl implements WorkspacePropertiesUpdateParameters { + private WorkspacePropertiesUpdateParametersInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + WorkspacePropertiesUpdateParametersImpl( + WorkspacePropertiesUpdateParametersInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String applicationInsights() { + return this.innerModel().applicationInsights(); + } + + public String containerRegistry() { + return this.innerModel().containerRegistry(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public EncryptionUpdateProperties encryption() { + return this.innerModel().encryption(); + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String imageBuildCompute() { + return this.innerModel().imageBuildCompute(); + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); + } + + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public Integer softDeleteRetentionInDays() { + return this.innerModel().softDeleteRetentionInDays(); + } + + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); + } + + public WorkspacePropertiesUpdateParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java new file mode 100644 index 0000000000000..245a93de2f63a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class WorkspaceUpdateParametersImpl implements WorkspaceUpdateParameters { + private WorkspaceUpdateParametersInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + WorkspaceUpdateParametersImpl( + WorkspaceUpdateParametersInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String applicationInsights() { + return this.innerModel().applicationInsights(); + } + + public String containerRegistry() { + return this.innerModel().containerRegistry(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public EncryptionUpdateProperties encryption() { + return this.innerModel().encryption(); + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String imageBuildCompute() { + return this.innerModel().imageBuildCompute(); + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); + } + + public PublicNetworkAccessType publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public Integer softDeleteRetentionInDays() { + return this.innerModel().softDeleteRetentionInDays(); + } + + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); + } + + public WorkspaceUpdateParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java index 31d06417842a9..130814b18e420 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java @@ -42,9 +42,9 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; import com.azure.resourcemanager.machinelearning.models.WorkspaceListResult; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -55,107 +55,116 @@ public final class WorkspacesClientImpl implements WorkspacesClient { private final WorkspacesService service; /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspacesClientImpl. * * @param client the instance of the service client containing this operation class. */ - WorkspacesClientImpl(AzureMachineLearningWorkspacesImpl client) { + WorkspacesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaces to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesWorkspaces to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspacesService { @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> list( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("kind") String kind, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") - @ExpectedResponses({200, 202}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceInner parameters, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, + @QueryParam("kind") String kind, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @QueryParam("forceToPurge") Boolean forceToPurge, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceUpdateParameters parameters, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkspaceUpdateParametersInner body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces") - @ExpectedResponses({200}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$skip") String skip, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkspaceInner body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> diagnose( @@ -164,119 +173,100 @@ Mono>> diagnose( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiagnoseWorkspaceParameters parameters, + @BodyParam("application/json") DiagnoseWorkspaceParameters body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") - @ExpectedResponses({200, 202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resyncKeys( + Mono> listNotebookAccessToken( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$skip") String skip, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNotebookAccessToken( + Mono> listNotebookKeys( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") - @ExpectedResponses({200, 202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> prepareNotebook( + Mono> listStorageAccountKeys( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listStorageAccountKeys( + Mono> listOutboundNetworkDependenciesEndpoints( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") - @ExpectedResponses({200}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNotebookKeys( + Mono>> prepareNotebook( @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") - @ExpectedResponses({200}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOutboundNetworkDependenciesEndpoints( + Mono>> resyncKeys( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -289,7 +279,7 @@ Mono> listOutboundNetworkDependenciesEndpoin @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -299,7 +289,7 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -307,19 +297,199 @@ Mono> listBySubscriptionNext( } /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skip, String kind) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skip, + kind, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skip, String kind, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skip, + kind, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skip, String kind) { + return new PagedFlux<>( + () -> listSinglePageAsync(skip, kind), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skip = null; + final String kind = null; + return new PagedFlux<>( + () -> listSinglePageAsync(skip, kind), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skip, String kind, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(skip, kind, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String skip = null; + final String kind = null; + return new PagedIterable<>(listAsync(skip, kind)); + } + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String skip, String kind, Context context) { + return new PagedIterable<>(listAsync(skip, kind, context)); + } + + /** + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skip, String kind) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -336,40 +506,48 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByResourceGroup( + .listByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, + this.client.getApiVersion(), + skip, + kind, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skip, String kind, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -386,85 +564,135 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( + .listByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, + this.client.getApiVersion(), + skip, + kind, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace on successful completion of {@link Mono}. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip, String kind) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, kind), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skip = null; + final String kind = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, kind), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available machine learning workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace along with {@link Response}. + * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String skip, String kind, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, kind, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { - return getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skip = null; + final String kind = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip, kind)); } /** - * Creates or updates a workspace with the specified parameters. + * Lists all the available machine learning workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String skip, String kind, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip, kind, context)); + } + + /** + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Boolean forceToPurge) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -484,44 +712,38 @@ private Mono>> createOrUpdateWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .delete( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - parameters, + this.client.getApiVersion(), + forceToPurge, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -541,195 +763,219 @@ private Mono>> createOrUpdateWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .delete( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - parameters, + this.client.getApiVersion(), + forceToPurge, accept, context); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, Boolean forceToPurge) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge); return this .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkspaceInner.class, - WorkspaceInner.class, - this.client.getContext()); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { + final Boolean forceToPurge = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { + final Boolean forceToPurge = null; + return this.beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge).getSyncPoller(); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge, context).getSyncPoller(); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Boolean forceToPurge) { + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName) { + final Boolean forceToPurge = null; + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters).block(); + public void delete(String resourceGroupName, String workspaceName) { + final Boolean forceToPurge = null; + deleteAsync(resourceGroupName, workspaceName, forceToPurge).block(); } /** - * Creates or updates a workspace with the specified parameters. + * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for creating or updating a machine learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).block(); + public void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + deleteAsync(resourceGroupName, workspaceName, forceToPurge, context).block(); } /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the properties of the specified machine learning workspace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -754,19 +1000,19 @@ private Mono>> deleteWithResponseAsync(String resource .withContext( context -> service - .delete( + .getByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -774,10 +1020,11 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the properties of the specified machine learning workspace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( + private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -801,105 +1048,34 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .getByResourceGroup( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } /** - * Deletes a machine learning workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a machine learning workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a machine learning workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); - } - - /** - * Deletes a machine learning workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); - } - - /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the properties of the specified machine learning workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName) { - return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -907,42 +1083,27 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a machine learning workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified machine learning workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName) { - deleteAsync(resourceGroupName, workspaceName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * Deletes a machine learning workspace. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, Context context) { - deleteAsync(resourceGroupName, workspaceName, context).block(); + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** @@ -950,7 +1111,7 @@ public void delete(String resourceGroupName, String workspaceName, Context conte * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -959,7 +1120,7 @@ public void delete(String resourceGroupName, String workspaceName, Context conte */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -979,10 +1140,10 @@ private Mono>> updateWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - parameters.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil @@ -991,11 +1152,11 @@ private Mono>> updateWithResponseAsync( service .update( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - parameters, + this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1006,7 +1167,7 @@ private Mono>> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1016,7 +1177,7 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1036,21 +1197,21 @@ private Mono>> updateWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - parameters.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - parameters, + this.client.getApiVersion(), + body, accept, context); } @@ -1060,7 +1221,7 @@ private Mono>> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1068,8 +1229,8 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, workspaceName, parameters); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, workspaceName, body); return this .client .getLroResult( @@ -1085,7 +1246,7 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1094,10 +1255,10 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context) { context = this.client.mergeContext(context); Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + updateWithResponseAsync(resourceGroupName, workspaceName, body, context); return this .client .getLroResult( @@ -1109,7 +1270,7 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1117,8 +1278,8 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, body).getSyncPoller(); } /** @@ -1126,7 +1287,7 @@ public SyncPoller, WorkspaceInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1135,8 +1296,8 @@ public SyncPoller, WorkspaceInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, body, context).getSyncPoller(); } /** @@ -1144,7 +1305,7 @@ public SyncPoller, WorkspaceInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1152,8 +1313,8 @@ public SyncPoller, WorkspaceInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { - return beginUpdateAsync(resourceGroupName, workspaceName, parameters) + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body) { + return beginUpdateAsync(resourceGroupName, workspaceName, body) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1163,7 +1324,7 @@ private Mono updateAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1172,8 +1333,8 @@ private Mono updateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, parameters, context) + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1183,15 +1344,15 @@ private Mono updateAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { - return updateAsync(resourceGroupName, workspaceName, parameters).block(); + public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body) { + return updateAsync(resourceGroupName, workspaceName, body).block(); } /** @@ -1199,7 +1360,7 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName, Wor * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameters for updating a machine learning workspace. + * @param body The parameters for updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1208,24 +1369,25 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName, Wor */ @ServiceMethod(returns = ReturnType.SINGLE) public WorkspaceInner update( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { - return updateAsync(resourceGroupName, workspaceName, parameters, context).block(); + String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner body, Context context) { + return updateAsync(resourceGroupName, workspaceName, body, context).block(); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return an object that represents a machine learning workspace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skip) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1242,46 +1404,47 @@ private Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByResourceGroup( + .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - skip, + workspaceName, + this.client.getApiVersion(), + body, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return an object that represents a machine learning workspace along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skip, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1298,111 +1461,183 @@ private Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( + .createOrUpdate( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - skip, + workspaceName, + this.client.getApiVersion(), + body, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceInner.class, + WorkspaceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + } + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, body).getSyncPoller(); + } + + /** + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, body, context).getSyncPoller(); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String skip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return an object that represents a machine learning workspace. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String skip = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, body).block(); } /** - * Lists all the available machine learning workspaces under the specified resource group. + * Creates or updates a workspace with the specified parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body The parameters for creating or updating a machine learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return an object that represents a machine learning workspace. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, body, context).block(); } /** @@ -1410,7 +1645,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1418,7 +1653,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> diagnoseWithResponseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1438,8 +1673,8 @@ private Mono>> diagnoseWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters != null) { - parameters.validate(); + if (body != null) { + body.validate(); } final String accept = "application/json"; return FluxUtil @@ -1452,7 +1687,7 @@ private Mono>> diagnoseWithResponseAsync( resourceGroupName, workspaceName, this.client.getApiVersion(), - parameters, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1463,7 +1698,7 @@ private Mono>> diagnoseWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1472,7 +1707,7 @@ private Mono>> diagnoseWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> diagnoseWithResponseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1492,8 +1727,8 @@ private Mono>> diagnoseWithResponseAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (parameters != null) { - parameters.validate(); + if (body != null) { + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1504,7 +1739,7 @@ private Mono>> diagnoseWithResponseAsync( resourceGroupName, workspaceName, this.client.getApiVersion(), - parameters, + body, accept, context); } @@ -1514,7 +1749,7 @@ private Mono>> diagnoseWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1522,8 +1757,8 @@ private Mono>> diagnoseWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { - Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body) { + Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, body); return this .client .getLroResult( @@ -1547,8 +1782,8 @@ private PollerFlux, DiagnoseResponseResu @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( String resourceGroupName, String workspaceName) { - final DiagnoseWorkspaceParameters parameters = null; - Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters); + final DiagnoseWorkspaceParameters body = null; + Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, body); return this .client .getLroResult( @@ -1564,7 +1799,7 @@ private PollerFlux, DiagnoseResponseResu * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1573,10 +1808,10 @@ private PollerFlux, DiagnoseResponseResu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { context = this.client.mergeContext(context); Mono>> mono = - diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + diagnoseWithResponseAsync(resourceGroupName, workspaceName, body, context); return this .client .getLroResult( @@ -1600,8 +1835,8 @@ private PollerFlux, DiagnoseResponseResu @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiagnoseResponseResultInner> beginDiagnose( String resourceGroupName, String workspaceName) { - final DiagnoseWorkspaceParameters parameters = null; - return this.beginDiagnoseAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); + final DiagnoseWorkspaceParameters body = null; + return this.beginDiagnoseAsync(resourceGroupName, workspaceName, body).getSyncPoller(); } /** @@ -1609,7 +1844,7 @@ public SyncPoller, DiagnoseResponseResul * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1618,8 +1853,8 @@ public SyncPoller, DiagnoseResponseResul */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiagnoseResponseResultInner> beginDiagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { - return this.beginDiagnoseAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { + return this.beginDiagnoseAsync(resourceGroupName, workspaceName, body, context).getSyncPoller(); } /** @@ -1627,7 +1862,7 @@ public SyncPoller, DiagnoseResponseResul * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1635,8 +1870,8 @@ public SyncPoller, DiagnoseResponseResul */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono diagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters) + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body) { + return beginDiagnoseAsync(resourceGroupName, workspaceName, body) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1653,8 +1888,8 @@ private Mono diagnoseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono diagnoseAsync(String resourceGroupName, String workspaceName) { - final DiagnoseWorkspaceParameters parameters = null; - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters) + final DiagnoseWorkspaceParameters body = null; + return beginDiagnoseAsync(resourceGroupName, workspaceName, body) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1664,7 +1899,7 @@ private Mono diagnoseAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1673,8 +1908,8 @@ private Mono diagnoseAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono diagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters, context) + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { + return beginDiagnoseAsync(resourceGroupName, workspaceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1691,8 +1926,8 @@ private Mono diagnoseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public DiagnoseResponseResultInner diagnose(String resourceGroupName, String workspaceName) { - final DiagnoseWorkspaceParameters parameters = null; - return diagnoseAsync(resourceGroupName, workspaceName, parameters).block(); + final DiagnoseWorkspaceParameters body = null; + return diagnoseAsync(resourceGroupName, workspaceName, body).block(); } /** @@ -1700,7 +1935,7 @@ public DiagnoseResponseResultInner diagnose(String resourceGroupName, String wor * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1709,8 +1944,8 @@ public DiagnoseResponseResultInner diagnose(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.SINGLE) public DiagnoseResponseResultInner diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { - return diagnoseAsync(resourceGroupName, workspaceName, parameters, context).block(); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { + return diagnoseAsync(resourceGroupName, workspaceName, body, context).block(); } /** @@ -1753,10 +1988,10 @@ private Mono> listKeysWithResponseAsync( service .listKeys( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1801,10 +2036,10 @@ private Mono> listKeysWithResponseAsync( return service .listKeys( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } @@ -1861,18 +2096,18 @@ public ListWorkspaceKeysResultInner listKeys(String resourceGroupName, String wo } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return azure Machine Learning Workspace notebook access token along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resyncKeysWithResponseAsync( + private Mono> listNotebookAccessTokenWithResponseAsync( String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono @@ -1898,20 +2133,19 @@ private Mono>> resyncKeysWithResponseAsync( .withContext( context -> service - .resyncKeys( + .listNotebookAccessToken( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -1919,10 +2153,11 @@ private Mono>> resyncKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return azure Machine Learning Workspace notebook access token along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resyncKeysWithResponseAsync( + private Mono> listNotebookAccessTokenWithResponseAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1946,39 +2181,35 @@ private Mono>> resyncKeysWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .resyncKeys( + .listNotebookAccessToken( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return azure Machine Learning Workspace notebook access token on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResyncKeysAsync(String resourceGroupName, String workspaceName) { - Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listNotebookAccessTokenAsync( + String resourceGroupName, String workspaceName) { + return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -1986,132 +2217,184 @@ private PollerFlux, Void> beginResyncKeysAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return azure Machine Learning Workspace notebook access token along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResyncKeysAsync( + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listNotebookAccessTokenWithResponse( String resourceGroupName, String workspaceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return azure Machine Learning Workspace notebook access token. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName) { - return this.beginResyncKeysAsync(resourceGroupName, workspaceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGroupName, String workspaceName) { + return listNotebookAccessTokenWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResyncKeys( - String resourceGroupName, String workspaceName, Context context) { - return this.beginResyncKeysAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNotebookKeysWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listNotebookKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resyncKeysAsync(String resourceGroupName, String workspaceName) { - return beginResyncKeysAsync(resourceGroupName, workspaceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listNotebookKeysWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNotebookKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resyncKeysAsync(String resourceGroupName, String workspaceName, Context context) { - return beginResyncKeysAsync(resourceGroupName, workspaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono listNotebookKeysAsync(String resourceGroupName, String workspaceName) { + return listNotebookKeysWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void resyncKeys(String resourceGroupName, String workspaceName) { - resyncKeysAsync(resourceGroupName, workspaceName).block(); + public Response listNotebookKeysWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listNotebookKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void resyncKeys(String resourceGroupName, String workspaceName, Context context) { - resyncKeysAsync(resourceGroupName, workspaceName, context).block(); + public ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, String workspaceName) { + return listNotebookKeysWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String skip) { + private Mono> listStorageAccountKeysWithResponseAsync( + String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2124,43 +2407,43 @@ private Mono> listSinglePageAsync(String skip) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .listStorageAccountKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String skip, Context context) { + private Mono> listStorageAccountKeysWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2173,105 +2456,77 @@ private Mono> listSinglePageAsync(String skip, Con new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .listStorageAccountKeys( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), - skip, + resourceGroupName, + workspaceName, + this.client.getApiVersion(), accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String skip) { - return new PagedFlux<>( - () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available machine learning workspaces under the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. + * @return the response body on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listStorageAccountKeysAsync( + String resourceGroupName, String workspaceName) { + return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String skip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(skip, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the available machine learning workspaces under the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String skip = null; - return new PagedIterable<>(listAsync(skip)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listStorageAccountKeysWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** - * Lists all the available machine learning workspaces under the specified subscription. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param skip Continuation token for pagination. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String skip, Context context) { - return new PagedIterable<>(listAsync(skip, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceGroupName, String workspaceName) { + return listStorageAccountKeysWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2281,7 +2536,7 @@ public PagedIterable list(String skip, Context context) { * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookAccessTokenWithResponseAsync( + private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono @@ -2307,19 +2562,19 @@ private Mono> listNotebookAccessTokenWi .withContext( context -> service - .listNotebookAccessToken( + .listOutboundNetworkDependenciesEndpoints( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2330,7 +2585,7 @@ private Mono> listNotebookAccessTokenWi * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookAccessTokenWithResponseAsync( + private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2354,18 +2609,18 @@ private Mono> listNotebookAccessTokenWi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNotebookAccessToken( + .listOutboundNetworkDependenciesEndpoints( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2375,14 +2630,14 @@ private Mono> listNotebookAccessTokenWi * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listNotebookAccessTokenAsync( + private Mono listOutboundNetworkDependenciesEndpointsAsync( String resourceGroupName, String workspaceName) { - return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName) + return listOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, workspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2393,13 +2648,14 @@ private Mono listNotebookAccessTokenAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNotebookAccessTokenWithResponse( + public Response listOutboundNetworkDependenciesEndpointsWithResponse( String resourceGroupName, String workspaceName, Context context) { - return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName, context).block(); + return listOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, workspaceName, context) + .block(); } /** - * return notebook access token and refresh token. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2409,12 +2665,14 @@ public Response listNotebookAccessTokenWithRespo * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGroupName, String workspaceName) { - return listNotebookAccessTokenWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + public ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String workspaceName) { + return listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, Context.NONE) + .getValue(); } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2452,17 +2710,17 @@ private Mono>> prepareNotebookWithResponseAsync( service .prepareNotebook( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2499,16 +2757,16 @@ private Mono>> prepareNotebookWithResponseAsync( return service .prepareNotebook( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2532,7 +2790,7 @@ private PollerFlux, NotebookResourceInfoIn } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2559,7 +2817,7 @@ private PollerFlux, NotebookResourceInfoIn } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2575,7 +2833,7 @@ public SyncPoller, NotebookResourceInfoInn } /** - * Prepare a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2584,235 +2842,93 @@ public SyncPoller, NotebookResourceInfoInn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( - String resourceGroupName, String workspaceName, Context context) { - return this.beginPrepareNotebookAsync(resourceGroupName, workspaceName, context).getSyncPoller(); - } - - /** - * Prepare a notebook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono prepareNotebookAsync(String resourceGroupName, String workspaceName) { - return beginPrepareNotebookAsync(resourceGroupName, workspaceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Prepare a notebook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono prepareNotebookAsync( - String resourceGroupName, String workspaceName, Context context) { - return beginPrepareNotebookAsync(resourceGroupName, workspaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Prepare a notebook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName) { - return prepareNotebookAsync(resourceGroupName, workspaceName).block(); - } - - /** - * Prepare a notebook. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName, Context context) { - return prepareNotebookAsync(resourceGroupName, workspaceName, context).block(); - } - - /** - * List storage account keys of a workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listStorageAccountKeysWithResponseAsync( - String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listStorageAccountKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( + String resourceGroupName, String workspaceName, Context context) { + return this.beginPrepareNotebookAsync(resourceGroupName, workspaceName, context).getSyncPoller(); } /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listStorageAccountKeysWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listStorageAccountKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + private Mono prepareNotebookAsync(String resourceGroupName, String workspaceName) { + return beginPrepareNotebookAsync(resourceGroupName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listStorageAccountKeysAsync( - String resourceGroupName, String workspaceName) { - return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono prepareNotebookAsync( + String resourceGroupName, String workspaceName, Context context) { + return beginPrepareNotebookAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName) { + return prepareNotebookAsync(resourceGroupName, workspaceName).block(); } /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceGroupName, String workspaceName) { - return listStorageAccountKeysWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, String workspaceName, Context context) { + return prepareNotebookAsync(resourceGroupName, workspaceName, context).block(); } /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookKeysWithResponseAsync( + private Mono>> resyncKeysWithResponseAsync( String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { return Mono @@ -2838,19 +2954,20 @@ private Mono> listNotebookKeysWithResponse .withContext( context -> service - .listNotebookKeys( + .resyncKeys( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2858,10 +2975,10 @@ private Mono> listNotebookKeysWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookKeysWithResponseAsync( + private Mono>> resyncKeysWithResponseAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2885,34 +3002,39 @@ private Mono> listNotebookKeysWithResponse final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNotebookKeys( + .resyncKeys( this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context); } /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listNotebookKeysAsync(String resourceGroupName, String workspaceName) { - return listNotebookKeysWithResponseAsync(resourceGroupName, workspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResyncKeysAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -2920,173 +3042,118 @@ private Mono listNotebookKeysAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNotebookKeysWithResponse( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResyncKeysAsync( String resourceGroupName, String workspaceName, Context context) { - return listNotebookKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); + context = this.client.mergeContext(context); + Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, String workspaceName) { - return listNotebookKeysWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName) { + return this.beginResyncKeysAsync(resourceGroupName, workspaceName).getSyncPoller(); } /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( - String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResyncKeys( + String resourceGroupName, String workspaceName, Context context) { + return this.beginResyncKeysAsync(resourceGroupName, workspaceName, context).getSyncPoller(); } /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context); + private Mono resyncKeysAsync(String resourceGroupName, String workspaceName) { + return beginResyncKeysAsync(resourceGroupName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listOutboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String workspaceName) { - return listOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, workspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono resyncKeysAsync(String resourceGroupName, String workspaceName, Context context) { + return beginResyncKeysAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, workspaceName, context) - .block(); + public void resyncKeys(String resourceGroupName, String workspaceName) { + resyncKeysAsync(resourceGroupName, workspaceName).block(); } /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String workspaceName) { - return listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, Context.NONE) - .getValue(); + public void resyncKeys(String resourceGroupName, String workspaceName, Context context) { + resyncKeysAsync(resourceGroupName, workspaceName, context).block(); } /** @@ -3101,7 +3168,7 @@ public ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -3114,7 +3181,7 @@ private Mono> listByResourceGroupNextSinglePageAsy final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -3140,7 +3207,7 @@ private Mono> listByResourceGroupNextSinglePageAsy * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( + private Mono> listBySubscriptionNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -3154,7 +3221,7 @@ private Mono> listByResourceGroupNextSinglePageAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -3178,7 +3245,7 @@ private Mono> listByResourceGroupNextSinglePageAsy * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -3191,7 +3258,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -3217,7 +3284,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( + private Mono> listByResourceGroupNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -3231,7 +3298,7 @@ private Mono> listBySubscriptionNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java index 75bd16e0e6576..049aba2c45b0d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java @@ -42,6 +42,36 @@ public WorkspacesImpl( this.serviceManager = serviceManager; } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String skip, String kind, Context context) { + PagedIterable inner = this.serviceClient().list(skip, kind, context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String skip, String kind, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, skip, kind, context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, forceToPurge, context); + } + public Response getByResourceGroupWithResponse( String resourceGroupName, String workspaceName, Context context) { Response inner = @@ -66,25 +96,6 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } - public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { - this.serviceClient().delete(resourceGroupName, workspaceName); - } - - public void delete(String resourceGroupName, String workspaceName, Context context) { - this.serviceClient().delete(resourceGroupName, workspaceName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, skip, context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - public DiagnoseResponseResult diagnose(String resourceGroupName, String workspaceName) { DiagnoseResponseResultInner inner = this.serviceClient().diagnose(resourceGroupName, workspaceName); if (inner != null) { @@ -95,9 +106,9 @@ public DiagnoseResponseResult diagnose(String resourceGroupName, String workspac } public DiagnoseResponseResult diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context) { DiagnoseResponseResultInner inner = - this.serviceClient().diagnose(resourceGroupName, workspaceName, parameters, context); + this.serviceClient().diagnose(resourceGroupName, workspaceName, body, context); if (inner != null) { return new DiagnoseResponseResultImpl(inner, this.manager()); } else { @@ -129,24 +140,6 @@ public ListWorkspaceKeysResult listKeys(String resourceGroupName, String workspa } } - public void resyncKeys(String resourceGroupName, String workspaceName) { - this.serviceClient().resyncKeys(resourceGroupName, workspaceName); - } - - public void resyncKeys(String resourceGroupName, String workspaceName, Context context) { - this.serviceClient().resyncKeys(resourceGroupName, workspaceName, context); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - - public PagedIterable list(String skip, Context context) { - PagedIterable inner = this.serviceClient().list(skip, context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); - } - public Response listNotebookAccessTokenWithResponse( String resourceGroupName, String workspaceName, Context context) { Response inner = @@ -172,20 +165,25 @@ public NotebookAccessTokenResult listNotebookAccessToken(String resourceGroupNam } } - public NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName) { - NotebookResourceInfoInner inner = this.serviceClient().prepareNotebook(resourceGroupName, workspaceName); + public Response listNotebookKeysWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new NotebookResourceInfoImpl(inner, this.manager()); + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListNotebookKeysResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName, Context context) { - NotebookResourceInfoInner inner = - this.serviceClient().prepareNotebook(resourceGroupName, workspaceName, context); + public ListNotebookKeysResult listNotebookKeys(String resourceGroupName, String workspaceName) { + ListNotebookKeysResultInner inner = this.serviceClient().listNotebookKeys(resourceGroupName, workspaceName); if (inner != null) { - return new NotebookResourceInfoImpl(inner, this.manager()); + return new ListNotebookKeysResultImpl(inner, this.manager()); } else { return null; } @@ -216,58 +214,61 @@ public ListStorageAccountKeysResult listStorageAccountKeys(String resourceGroupN } } - public Response listNotebookKeysWithResponse( + public Response listOutboundNetworkDependenciesEndpointsWithResponse( String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); + Response inner = + this + .serviceClient() + .listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ListNotebookKeysResultImpl(inner.getValue(), this.manager())); + new ExternalFqdnResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public ListNotebookKeysResult listNotebookKeys(String resourceGroupName, String workspaceName) { - ListNotebookKeysResultInner inner = this.serviceClient().listNotebookKeys(resourceGroupName, workspaceName); + public ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String workspaceName) { + ExternalFqdnResponseInner inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, workspaceName); if (inner != null) { - return new ListNotebookKeysResultImpl(inner, this.manager()); + return new ExternalFqdnResponseImpl(inner, this.manager()); } else { return null; } } - public Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this - .serviceClient() - .listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, context); + public NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName) { + NotebookResourceInfoInner inner = this.serviceClient().prepareNotebook(resourceGroupName, workspaceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExternalFqdnResponseImpl(inner.getValue(), this.manager())); + return new NotebookResourceInfoImpl(inner, this.manager()); } else { return null; } } - public ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String workspaceName) { - ExternalFqdnResponseInner inner = - this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, workspaceName); + public NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName, Context context) { + NotebookResourceInfoInner inner = + this.serviceClient().prepareNotebook(resourceGroupName, workspaceName, context); if (inner != null) { - return new ExternalFqdnResponseImpl(inner, this.manager()); + return new NotebookResourceInfoImpl(inner, this.manager()); } else { return null; } } + public void resyncKeys(String resourceGroupName, String workspaceName) { + this.serviceClient().resyncKeys(resourceGroupName, workspaceName); + } + + public void resyncKeys(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().resyncKeys(resourceGroupName, workspaceName, context); + } + public Workspace getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -322,10 +323,11 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - this.delete(resourceGroupName, workspaceName, Context.NONE); + Boolean localForceToPurge = null; + this.delete(resourceGroupName, workspaceName, localForceToPurge, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Boolean forceToPurge, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -341,7 +343,7 @@ public void deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - this.delete(resourceGroupName, workspaceName, context); + this.delete(resourceGroupName, workspaceName, forceToPurge, context); } private WorkspacesClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java index d69c58716f983..4d32798ab03b6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for AzureMachineLearningWorkspaces. These APIs allow end users to operate on + * Package containing the implementations for AzureMachineLearningServices. These APIs allow end users to operate on * Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.implementation; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..495a565558b43 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The AccessKeyAuthTypeWorkspaceConnectionProperties model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("AccessKey") +@Fluent +public final class AccessKeyAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * The credentials property. + */ + @JsonProperty(value = "credentials") + private WorkspaceConnectionAccessKey credentials; + + /** Creates an instance of AccessKeyAuthTypeWorkspaceConnectionProperties class. */ + public AccessKeyAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public WorkspaceConnectionAccessKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the AccessKeyAuthTypeWorkspaceConnectionProperties object itself. + */ + public AccessKeyAuthTypeWorkspaceConnectionProperties withCredentials(WorkspaceConnectionAccessKey credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java index 3a914e9d93088..7b3bc9adeb73e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java @@ -18,7 +18,7 @@ public final class AccountKeyDatastoreCredentials extends DatastoreCredentials { /* * [Required] Storage account secrets. */ - @JsonProperty(value = "secrets", required = true) + @JsonProperty(value = "secrets") private AccountKeyDatastoreSecrets secrets; /** Creates an instance of AccountKeyDatastoreCredentials class. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java new file mode 100644 index 0000000000000..d1a4ad3d3d5cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of ACR account to be used for the Registry. */ +@Fluent +public final class AcrDetails { + /* + * Details of system created ACR account to be used for the Registry + */ + @JsonProperty(value = "systemCreatedAcrAccount") + private SystemCreatedAcrAccount systemCreatedAcrAccount; + + /* + * Details of user created ACR account to be used for the Registry + */ + @JsonProperty(value = "userCreatedAcrAccount") + private UserCreatedAcrAccount userCreatedAcrAccount; + + /** Creates an instance of AcrDetails class. */ + public AcrDetails() { + } + + /** + * Get the systemCreatedAcrAccount property: Details of system created ACR account to be used for the Registry. + * + * @return the systemCreatedAcrAccount value. + */ + public SystemCreatedAcrAccount systemCreatedAcrAccount() { + return this.systemCreatedAcrAccount; + } + + /** + * Set the systemCreatedAcrAccount property: Details of system created ACR account to be used for the Registry. + * + * @param systemCreatedAcrAccount the systemCreatedAcrAccount value to set. + * @return the AcrDetails object itself. + */ + public AcrDetails withSystemCreatedAcrAccount(SystemCreatedAcrAccount systemCreatedAcrAccount) { + this.systemCreatedAcrAccount = systemCreatedAcrAccount; + return this; + } + + /** + * Get the userCreatedAcrAccount property: Details of user created ACR account to be used for the Registry. + * + * @return the userCreatedAcrAccount value. + */ + public UserCreatedAcrAccount userCreatedAcrAccount() { + return this.userCreatedAcrAccount; + } + + /** + * Set the userCreatedAcrAccount property: Details of user created ACR account to be used for the Registry. + * + * @param userCreatedAcrAccount the userCreatedAcrAccount value to set. + * @return the AcrDetails object itself. + */ + public AcrDetails withUserCreatedAcrAccount(UserCreatedAcrAccount userCreatedAcrAccount) { + this.userCreatedAcrAccount = userCreatedAcrAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemCreatedAcrAccount() != null) { + systemCreatedAcrAccount().validate(); + } + if (userCreatedAcrAccount() != null) { + userCreatedAcrAccount().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java new file mode 100644 index 0000000000000..c2548fae0435c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The AllFeatures model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "filterType") +@JsonTypeName("AllFeatures") +@Immutable +public final class AllFeatures extends MonitoringFeatureFilterBase { + /** Creates an instance of AllFeatures class. */ + public AllFeatures() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java new file mode 100644 index 0000000000000..cf9fcd13eceff --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** All nodes means the service will be running on all of the nodes of the job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "nodesValueType") +@JsonTypeName("All") +@Immutable +public final class AllNodes extends Nodes { + /** Creates an instance of AllNodes class. */ + public AllNodes() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java index 89261a24cb42c..51a7147391578 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java @@ -9,18 +9,11 @@ /** An immutable client-side representation of AmlOperation. */ public interface AmlOperation { /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Display name of operation. + * Gets the display property: Gets or sets display name of operation. * * @return the display value. */ - AmlOperationDisplay display(); + OperationDisplay display(); /** * Gets the isDataAction property: Indicates whether the operation applies to data-plane. @@ -29,6 +22,20 @@ public interface AmlOperation { */ Boolean isDataAction(); + /** + * Gets the name property: Gets or sets operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the origin property: The intended executor of the operation: user/system. + * + * @return the origin value. + */ + String origin(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner object. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java deleted file mode 100644 index 2bf229e370c1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display name of operation. */ -@Fluent -public final class AmlOperationDisplay { - /* - * The resource provider name: Microsoft.MachineLearningExperimentation - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * The operation that users can perform. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * The description for the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** Creates an instance of AmlOperationDisplay class. */ - public AmlOperationDisplay() { - } - - /** - * Get the provider property: The resource provider name: Microsoft.MachineLearningExperimentation. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The resource provider name: Microsoft.MachineLearningExperimentation. - * - * @param provider the provider value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The operation that users can perform. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The operation that users can perform. - * - * @param operation the operation value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The description for the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description for the operation. - * - * @param description the description value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java index 49d6cbce0d995..813bc10e9ee77 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java @@ -13,7 +13,8 @@ @Fluent public final class AmlOperationListResult { /* - * List of AML workspace operations supported by the AML workspace resource provider. + * Gets or sets list of AML team account operations supported by the + * AML team account resource provider. */ @JsonProperty(value = "value") private List value; @@ -23,7 +24,8 @@ public AmlOperationListResult() { } /** - * Get the value property: List of AML workspace operations supported by the AML workspace resource provider. + * Get the value property: Gets or sets list of AML team account operations supported by the AML team account + * resource provider. * * @return the value value. */ @@ -32,7 +34,8 @@ public List value() { } /** - * Set the value property: List of AML workspace operations supported by the AML workspace resource provider. + * Set the value property: Gets or sets list of AML team account operations supported by the AML team account + * resource provider. * * @param value the value value to set. * @return the AmlOperationListResult object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java new file mode 100644 index 0000000000000..79053ffae7045 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** AML token compute identity definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeIdentityType") +@JsonTypeName("AmlToken") +@Immutable +public final class AmlTokenComputeIdentity extends MonitorComputeIdentityBase { + /** Creates an instance of AmlTokenComputeIdentity class. */ + public AmlTokenComputeIdentity() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..c8e545d146ba8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** + * This connection type covers the generic ApiKey auth connection categories, for examples: AzureOpenAI: Category:= + * AzureOpenAI AuthType:= ApiKey (as type discriminator) Credentials:= {ApiKey} as + * Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase} + * + *

CognitiveService: Category:= CognitiveService AuthType:= ApiKey (as type discriminator) Credentials:= + * {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= + * ServiceRegion={serviceRegion} + * + *

CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (as type discriminator) Credentials:= {Key} as + * Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint} + * + *

Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("ApiKey") +@Fluent +public final class ApiKeyAuthWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Api key object for workspace connection credential. + */ + @JsonProperty(value = "credentials") + private WorkspaceConnectionApiKey credentials; + + /** Creates an instance of ApiKeyAuthWorkspaceConnectionProperties class. */ + public ApiKeyAuthWorkspaceConnectionProperties() { + } + + /** + * Get the credentials property: Api key object for workspace connection credential. + * + * @return the credentials value. + */ + public WorkspaceConnectionApiKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Api key object for workspace connection credential. + * + * @param credentials the credentials value to set. + * @return the ApiKeyAuthWorkspaceConnectionProperties object itself. + */ + public ApiKeyAuthWorkspaceConnectionProperties withCredentials(WorkspaceConnectionApiKey credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java new file mode 100644 index 0000000000000..50e0ba5cedbfe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ARM ResourceId of a resource. */ +@Fluent +public final class ArmResourceId { + /* + * Arm ResourceId is in the format + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" + * or + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}" + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** Creates an instance of ArmResourceId class. */ + public ArmResourceId() { + } + + /** + * Get the resourceId property: Arm ResourceId is in the format + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" + * or + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Arm ResourceId is in the format + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" + * or + * "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}". + * + * @param resourceId the resourceId value to set. + * @return the ArmResourceId object itself. + */ + public ArmResourceId withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java index 603e689cf5fa1..489eea4014508 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java @@ -12,13 +12,21 @@ @Fluent public class AssetBase extends ResourceBase { /* - * If the name version are system generated (anonymous registration). + * Specifies the lifecycle setting of managed data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + + /* + * If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage + * is provided it will be used to populate IsAnonymous */ @JsonProperty(value = "isAnonymous") private Boolean isAnonymous; /* - * Is the asset archived? + * Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate + * IsArchived */ @JsonProperty(value = "isArchived") private Boolean isArchived; @@ -28,7 +36,28 @@ public AssetBase() { } /** - * Get the isAnonymous property: If the name version are system generated (anonymous registration). + * Get the autoDeleteSetting property: Specifies the lifecycle setting of managed data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Specifies the lifecycle setting of managed data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the AssetBase object itself. + */ + public AssetBase withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + + /** + * Get the isAnonymous property: If the name version are system generated (anonymous registration). For types where + * Stage is defined, when Stage is provided it will be used to populate IsAnonymous. * * @return the isAnonymous value. */ @@ -37,7 +66,8 @@ public Boolean isAnonymous() { } /** - * Set the isAnonymous property: If the name version are system generated (anonymous registration). + * Set the isAnonymous property: If the name version are system generated (anonymous registration). For types where + * Stage is defined, when Stage is provided it will be used to populate IsAnonymous. * * @param isAnonymous the isAnonymous value to set. * @return the AssetBase object itself. @@ -48,7 +78,8 @@ public AssetBase withIsAnonymous(Boolean isAnonymous) { } /** - * Get the isArchived property: Is the asset archived?. + * Get the isArchived property: Is the asset archived? For types where Stage is defined, when Stage is provided it + * will be used to populate IsArchived. * * @return the isArchived value. */ @@ -57,7 +88,8 @@ public Boolean isArchived() { } /** - * Set the isArchived property: Is the asset archived?. + * Set the isArchived property: Is the asset archived? For types where Stage is defined, when Stage is provided it + * will be used to populate IsArchived. * * @param isArchived the isArchived value to set. * @return the AssetBase object itself. @@ -96,5 +128,8 @@ public AssetBase withTags(Map tags) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java index e6c3f9463eab9..cde2a908aa210 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java @@ -10,6 +10,24 @@ /** Asset output type. */ @Fluent public class AssetJobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -26,6 +44,66 @@ public class AssetJobOutput { public AssetJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the AssetJobOutput object itself. + */ + public AssetJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the AssetJobOutput object itself. + */ + public AssetJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the AssetJobOutput object itself. + */ + public AssetJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -72,5 +150,8 @@ public AssetJobOutput withUri(String uri) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java new file mode 100644 index 0000000000000..b4358f12b3a5a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of registry asset. */ +public final class AssetProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AssetProvisioningState. */ + public static final AssetProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AssetProvisioningState. */ + public static final AssetProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for AssetProvisioningState. */ + public static final AssetProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Creating for AssetProvisioningState. */ + public static final AssetProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for AssetProvisioningState. */ + public static final AssetProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for AssetProvisioningState. */ + public static final AssetProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of AssetProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssetProvisioningState() { + } + + /** + * Creates or finds a AssetProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetProvisioningState. + */ + @JsonCreator + public static AssetProvisioningState fromString(String name) { + return fromString(name, AssetProvisioningState.class); + } + + /** + * Gets known AssetProvisioningState values. + * + * @return known AssetProvisioningState values. + */ + public static Collection values() { + return values(AssetProvisioningState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java index e19aef73ced20..81aff46bc5c04 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java @@ -17,8 +17,8 @@ defaultImpl = AssetReferenceBase.class) @JsonTypeName("AssetReferenceBase") @JsonSubTypes({ - @JsonSubTypes.Type(name = "DataPath", value = DataPathAssetReference.class), @JsonSubTypes.Type(name = "Id", value = IdAssetReference.class), + @JsonSubTypes.Type(name = "DataPath", value = DataPathAssetReference.class), @JsonSubTypes.Type(name = "OutputPath", value = OutputPathAssetReference.class) }) @Immutable diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteCondition.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteCondition.java new file mode 100644 index 0000000000000..289d6ff59bd33 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteCondition.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutoDeleteCondition. */ +public final class AutoDeleteCondition extends ExpandableStringEnum { + /** Static value CreatedGreaterThan for AutoDeleteCondition. */ + public static final AutoDeleteCondition CREATED_GREATER_THAN = fromString("CreatedGreaterThan"); + + /** Static value LastAccessedGreaterThan for AutoDeleteCondition. */ + public static final AutoDeleteCondition LAST_ACCESSED_GREATER_THAN = fromString("LastAccessedGreaterThan"); + + /** + * Creates a new instance of AutoDeleteCondition value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoDeleteCondition() { + } + + /** + * Creates or finds a AutoDeleteCondition from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoDeleteCondition. + */ + @JsonCreator + public static AutoDeleteCondition fromString(String name) { + return fromString(name, AutoDeleteCondition.class); + } + + /** + * Gets known AutoDeleteCondition values. + * + * @return known AutoDeleteCondition values. + */ + public static Collection values() { + return values(AutoDeleteCondition.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteSetting.java new file mode 100644 index 0000000000000..114f325991c60 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoDeleteSetting.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AutoDeleteSetting model. */ +@Fluent +public final class AutoDeleteSetting { + /* + * When to check if an asset is expired + */ + @JsonProperty(value = "condition") + private AutoDeleteCondition condition; + + /* + * Expiration condition value. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of AutoDeleteSetting class. */ + public AutoDeleteSetting() { + } + + /** + * Get the condition property: When to check if an asset is expired. + * + * @return the condition value. + */ + public AutoDeleteCondition condition() { + return this.condition; + } + + /** + * Set the condition property: When to check if an asset is expired. + * + * @param condition the condition value to set. + * @return the AutoDeleteSetting object itself. + */ + public AutoDeleteSetting withCondition(AutoDeleteCondition condition) { + this.condition = condition; + return this; + } + + /** + * Get the value property: Expiration condition value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Expiration condition value. + * + * @param value the value value to set. + * @return the AutoDeleteSetting object itself. + */ + public AutoDeleteSetting withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java index a9118767dc85a..8b21f7dbbc129 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java @@ -42,6 +42,12 @@ public final class AutoMLJob extends JobBaseProperties { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; + /* + * Queue settings for the job + */ + @JsonProperty(value = "queueSettings") + private QueueSettings queueSettings; + /* * Compute Resource configuration for the job. */ @@ -122,6 +128,26 @@ public AutoMLJob withOutputs(Map outputs) { return this; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the AutoMLJob object itself. + */ + public AutoMLJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the resources property: Compute Resource configuration for the job. * @@ -204,6 +230,20 @@ public AutoMLJob withIsArchived(Boolean isArchived) { return this; } + /** {@inheritDoc} */ + @Override + public AutoMLJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public AutoMLJob withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + /** {@inheritDoc} */ @Override public AutoMLJob withServices(Map services) { @@ -250,6 +290,9 @@ public void validate() { } }); } + if (queueSettings() != null) { + queueSettings().validate(); + } if (resources() != null) { resources().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutologgerSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutologgerSettings.java new file mode 100644 index 0000000000000..040f93e9bec53 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutologgerSettings.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for Autologger. */ +@Fluent +public final class AutologgerSettings { + /* + * [Required] Indicates whether mlflow autologger is enabled. + */ + @JsonProperty(value = "mlflowAutologger", required = true) + private MLFlowAutologgerState mlflowAutologger; + + /** Creates an instance of AutologgerSettings class. */ + public AutologgerSettings() { + } + + /** + * Get the mlflowAutologger property: [Required] Indicates whether mlflow autologger is enabled. + * + * @return the mlflowAutologger value. + */ + public MLFlowAutologgerState mlflowAutologger() { + return this.mlflowAutologger; + } + + /** + * Set the mlflowAutologger property: [Required] Indicates whether mlflow autologger is enabled. + * + * @param mlflowAutologger the mlflowAutologger value to set. + * @return the AutologgerSettings object itself. + */ + public AutologgerSettings withMlflowAutologger(MLFlowAutologgerState mlflowAutologger) { + this.mlflowAutologger = mlflowAutologger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mlflowAutologger() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property mlflowAutologger in model AutologgerSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AutologgerSettings.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzMonMonitoringAlertNotificationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzMonMonitoringAlertNotificationSettings.java new file mode 100644 index 0000000000000..784ff1387f5a8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzMonMonitoringAlertNotificationSettings.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The AzMonMonitoringAlertNotificationSettings model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertNotificationType") +@JsonTypeName("AzureMonitor") +@Immutable +public final class AzMonMonitoringAlertNotificationSettings extends MonitoringAlertNotificationSettingsBase { + /** Creates an instance of AzMonMonitoringAlertNotificationSettings class. */ + public AzMonMonitoringAlertNotificationSettings() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java index 24e0474c29dd5..2a44273d05f30 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java @@ -45,6 +45,18 @@ public final class AzureBlobDatastore extends DatastoreProperties { @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; + /* + * Azure Resource Group name + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Azure Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + /** Creates an instance of AzureBlobDatastore class. */ public AzureBlobDatastore() { } @@ -152,6 +164,46 @@ public AzureBlobDatastore withServiceDataAccessAuthIdentity( return this; } + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureBlobDatastore object itself. + */ + public AzureBlobDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureBlobDatastore object itself. + */ + public AzureBlobDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** {@inheritDoc} */ @Override public AzureBlobDatastore withCredentials(DatastoreCredentials credentials) { @@ -159,6 +211,13 @@ public AzureBlobDatastore withCredentials(DatastoreCredentials credentials) { return this; } + /** {@inheritDoc} */ + @Override + public AzureBlobDatastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + /** {@inheritDoc} */ @Override public AzureBlobDatastore withDescription(String description) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java index f2512a5a47e5b..d66f819cde5e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java @@ -28,6 +28,18 @@ public final class AzureDataLakeGen1Datastore extends DatastoreProperties { @JsonProperty(value = "storeName", required = true) private String storeName; + /* + * Azure Resource Group name + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Azure Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + /** Creates an instance of AzureDataLakeGen1Datastore class. */ public AzureDataLakeGen1Datastore() { } @@ -75,6 +87,46 @@ public AzureDataLakeGen1Datastore withStoreName(String storeName) { return this; } + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDataLakeGen1Datastore object itself. + */ + public AzureDataLakeGen1Datastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDataLakeGen1Datastore object itself. + */ + public AzureDataLakeGen1Datastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** {@inheritDoc} */ @Override public AzureDataLakeGen1Datastore withCredentials(DatastoreCredentials credentials) { @@ -82,6 +134,13 @@ public AzureDataLakeGen1Datastore withCredentials(DatastoreCredentials credentia return this; } + /** {@inheritDoc} */ + @Override + public AzureDataLakeGen1Datastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + /** {@inheritDoc} */ @Override public AzureDataLakeGen1Datastore withDescription(String description) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java index 11fa5841c6ae6..947ace20cccdb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java @@ -46,6 +46,18 @@ public final class AzureDataLakeGen2Datastore extends DatastoreProperties { @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; + /* + * Azure Resource Group name + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Azure Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + /** Creates an instance of AzureDataLakeGen2Datastore class. */ public AzureDataLakeGen2Datastore() { } @@ -153,6 +165,46 @@ public AzureDataLakeGen2Datastore withServiceDataAccessAuthIdentity( return this; } + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDataLakeGen2Datastore object itself. + */ + public AzureDataLakeGen2Datastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDataLakeGen2Datastore object itself. + */ + public AzureDataLakeGen2Datastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** {@inheritDoc} */ @Override public AzureDataLakeGen2Datastore withCredentials(DatastoreCredentials credentials) { @@ -160,6 +212,13 @@ public AzureDataLakeGen2Datastore withCredentials(DatastoreCredentials credentia return this; } + /** {@inheritDoc} */ + @Override + public AzureDataLakeGen2Datastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + /** {@inheritDoc} */ @Override public AzureDataLakeGen2Datastore withDescription(String description) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java new file mode 100644 index 0000000000000..5fa79bf3bdb06 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base definition for Azure datastore contents configuration. */ +@Fluent +public class AzureDatastore { + /* + * Azure Resource Group name + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Azure Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** Creates an instance of AzureDatastore class. */ + public AzureDatastore() { + } + + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDatastore object itself. + */ + public AzureDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDatastore object itself. + */ + public AzureDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java new file mode 100644 index 0000000000000..0f12557830150 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Webhook details specific for Azure DevOps. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "webhookType") +@JsonTypeName("AzureDevOps") +@Fluent +public final class AzureDevOpsWebhook extends Webhook { + /** Creates an instance of AzureDevOpsWebhook class. */ + public AzureDevOpsWebhook() { + } + + /** {@inheritDoc} */ + @Override + public AzureDevOpsWebhook withEventType(String eventType) { + super.withEventType(eventType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java index af3f62739d13d..3e5b8433f599f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java @@ -46,6 +46,18 @@ public final class AzureFileDatastore extends DatastoreProperties { @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; + /* + * Azure Resource Group name + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Azure Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + /** Creates an instance of AzureFileDatastore class. */ public AzureFileDatastore() { } @@ -153,6 +165,46 @@ public AzureFileDatastore withServiceDataAccessAuthIdentity( return this; } + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureFileDatastore object itself. + */ + public AzureFileDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureFileDatastore object itself. + */ + public AzureFileDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** {@inheritDoc} */ @Override public AzureFileDatastore withCredentials(DatastoreCredentials credentials) { @@ -160,6 +212,13 @@ public AzureFileDatastore withCredentials(DatastoreCredentials credentials) { return this; } + /** {@inheritDoc} */ + @Override + public AzureFileDatastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + /** {@inheritDoc} */ @Override public AzureFileDatastore withDescription(String description) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLBatchInferencingServer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLBatchInferencingServer.java new file mode 100644 index 0000000000000..219ac047817f9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLBatchInferencingServer.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure ML batch inferencing server configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serverType") +@JsonTypeName("AzureMLBatch") +@Fluent +public final class AzureMLBatchInferencingServer extends InferencingServer { + /* + * Code configuration for AML batch inferencing server. + */ + @JsonProperty(value = "codeConfiguration") + private CodeConfiguration codeConfiguration; + + /** Creates an instance of AzureMLBatchInferencingServer class. */ + public AzureMLBatchInferencingServer() { + } + + /** + * Get the codeConfiguration property: Code configuration for AML batch inferencing server. + * + * @return the codeConfiguration value. + */ + public CodeConfiguration codeConfiguration() { + return this.codeConfiguration; + } + + /** + * Set the codeConfiguration property: Code configuration for AML batch inferencing server. + * + * @param codeConfiguration the codeConfiguration value to set. + * @return the AzureMLBatchInferencingServer object itself. + */ + public AzureMLBatchInferencingServer withCodeConfiguration(CodeConfiguration codeConfiguration) { + this.codeConfiguration = codeConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (codeConfiguration() != null) { + codeConfiguration().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLOnlineInferencingServer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLOnlineInferencingServer.java new file mode 100644 index 0000000000000..d5c68f834a564 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureMLOnlineInferencingServer.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure ML online inferencing configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serverType") +@JsonTypeName("AzureMLOnline") +@Fluent +public final class AzureMLOnlineInferencingServer extends InferencingServer { + /* + * Code configuration for AML inferencing server. + */ + @JsonProperty(value = "codeConfiguration") + private CodeConfiguration codeConfiguration; + + /** Creates an instance of AzureMLOnlineInferencingServer class. */ + public AzureMLOnlineInferencingServer() { + } + + /** + * Get the codeConfiguration property: Code configuration for AML inferencing server. + * + * @return the codeConfiguration value. + */ + public CodeConfiguration codeConfiguration() { + return this.codeConfiguration; + } + + /** + * Set the codeConfiguration property: Code configuration for AML inferencing server. + * + * @param codeConfiguration the codeConfiguration value to set. + * @return the AzureMLOnlineInferencingServer object itself. + */ + public AzureMLOnlineInferencingServer withCodeConfiguration(CodeConfiguration codeConfiguration) { + this.codeConfiguration = codeConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (codeConfiguration() != null) { + codeConfiguration().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentId.java new file mode 100644 index 0000000000000..be7f10bb1fbee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentId.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base environment type. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "baseEnvironmentSourceType") +@JsonTypeName("EnvironmentAsset") +@Fluent +public final class BaseEnvironmentId extends BaseEnvironmentSource { + /* + * [Required] Resource id accepting ArmId or AzureMlId. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** Creates an instance of BaseEnvironmentId class. */ + public BaseEnvironmentId() { + } + + /** + * Get the resourceId property: [Required] Resource id accepting ArmId or AzureMlId. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: [Required] Resource id accepting ArmId or AzureMlId. + * + * @param resourceId the resourceId value to set. + * @return the BaseEnvironmentId object itself. + */ + public BaseEnvironmentId withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model BaseEnvironmentId")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BaseEnvironmentId.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSource.java new file mode 100644 index 0000000000000..89dfb91be88ae --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSource.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The BaseEnvironmentSource model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "baseEnvironmentSourceType", + defaultImpl = BaseEnvironmentSource.class) +@JsonTypeName("BaseEnvironmentSource") +@JsonSubTypes({@JsonSubTypes.Type(name = "EnvironmentAsset", value = BaseEnvironmentId.class)}) +@Immutable +public class BaseEnvironmentSource { + /** Creates an instance of BaseEnvironmentSource class. */ + public BaseEnvironmentSource() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSourceType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSourceType.java new file mode 100644 index 0000000000000..e028755603a16 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BaseEnvironmentSourceType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Base environment type. */ +public final class BaseEnvironmentSourceType extends ExpandableStringEnum { + /** Static value EnvironmentAsset for BaseEnvironmentSourceType. */ + public static final BaseEnvironmentSourceType ENVIRONMENT_ASSET = fromString("EnvironmentAsset"); + + /** + * Creates a new instance of BaseEnvironmentSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BaseEnvironmentSourceType() { + } + + /** + * Creates or finds a BaseEnvironmentSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BaseEnvironmentSourceType. + */ + @JsonCreator + public static BaseEnvironmentSourceType fromString(String name) { + return fromString(name, BaseEnvironmentSourceType.class); + } + + /** + * Gets known BaseEnvironmentSourceType values. + * + * @return known BaseEnvironmentSourceType values. + */ + public static Collection values() { + return values(BaseEnvironmentSourceType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java index ff78009e7cdf7..487f495eac097 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java @@ -119,11 +119,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The BatchDeployment definition stages. */ interface DefinitionStages { /** The first stage of the BatchDeployment definition. */ interface Blank extends WithLocation { } + /** The stage of the BatchDeployment definition allowing to specify location. */ interface WithLocation { /** @@ -142,6 +144,7 @@ interface WithLocation { */ WithParentResource withRegion(String location); } + /** The stage of the BatchDeployment definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -155,6 +158,7 @@ interface WithParentResource { WithProperties withExistingBatchEndpoint( String resourceGroupName, String workspaceName, String endpointName); } + /** The stage of the BatchDeployment definition allowing to specify properties. */ interface WithProperties { /** @@ -165,6 +169,7 @@ interface WithProperties { */ WithCreate withProperties(BatchDeploymentProperties properties); } + /** * The stage of the BatchDeployment definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -189,6 +194,7 @@ interface WithCreate */ BatchDeployment create(Context context); } + /** The stage of the BatchDeployment definition allowing to specify tags. */ interface WithTags { /** @@ -199,6 +205,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the BatchDeployment definition allowing to specify identity. */ interface WithIdentity { /** @@ -210,6 +217,7 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the BatchDeployment definition allowing to specify kind. */ interface WithKind { /** @@ -222,6 +230,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the BatchDeployment definition allowing to specify sku. */ interface WithSku { /** @@ -233,6 +242,7 @@ interface WithSku { WithCreate withSku(Sku sku); } } + /** * Begins update for the BatchDeployment resource. * @@ -257,6 +267,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { */ BatchDeployment apply(Context context); } + /** The BatchDeployment update stages. */ interface UpdateStages { /** The stage of the BatchDeployment update allowing to specify tags. */ @@ -269,6 +280,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the BatchDeployment update allowing to specify properties. */ interface WithProperties { /** @@ -280,6 +292,7 @@ interface WithProperties { Update withProperties(PartialBatchDeployment properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java new file mode 100644 index 0000000000000..21b0273c79c4b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties relevant to different deployment types. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "deploymentConfigurationType", + defaultImpl = BatchDeploymentConfiguration.class) +@JsonTypeName("BatchDeploymentConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PipelineComponent", value = BatchPipelineComponentDeploymentConfiguration.class) +}) +@Immutable +public class BatchDeploymentConfiguration { + /** Creates an instance of BatchDeploymentConfiguration class. */ + public BatchDeploymentConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java new file mode 100644 index 0000000000000..3cc34aeb15947 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The enumerated property types for batch deployments. */ +public final class BatchDeploymentConfigurationType extends ExpandableStringEnum { + /** Static value Model for BatchDeploymentConfigurationType. */ + public static final BatchDeploymentConfigurationType MODEL = fromString("Model"); + + /** Static value PipelineComponent for BatchDeploymentConfigurationType. */ + public static final BatchDeploymentConfigurationType PIPELINE_COMPONENT = fromString("PipelineComponent"); + + /** + * Creates a new instance of BatchDeploymentConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BatchDeploymentConfigurationType() { + } + + /** + * Creates or finds a BatchDeploymentConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchDeploymentConfigurationType. + */ + @JsonCreator + public static BatchDeploymentConfigurationType fromString(String name) { + return fromString(name, BatchDeploymentConfigurationType.class); + } + + /** + * Gets known BatchDeploymentConfigurationType values. + * + * @return known BatchDeploymentConfigurationType values. + */ + public static Collection values() { + return values(BatchDeploymentConfigurationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java index c9edec18e058e..28aea89ec799e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java @@ -17,6 +17,12 @@ public final class BatchDeploymentProperties extends EndpointDeploymentPropertie @JsonProperty(value = "compute") private String compute; + /* + * Properties relevant to different deployment types. + */ + @JsonProperty(value = "deploymentConfiguration") + private BatchDeploymentConfiguration deploymentConfiguration; + /* * Error threshold, if the error count for the entire input goes above this value, * the batch inference will be aborted. Range is [-1, int.MaxValue]. @@ -109,6 +115,26 @@ public BatchDeploymentProperties withCompute(String compute) { return this; } + /** + * Get the deploymentConfiguration property: Properties relevant to different deployment types. + * + * @return the deploymentConfiguration value. + */ + public BatchDeploymentConfiguration deploymentConfiguration() { + return this.deploymentConfiguration; + } + + /** + * Set the deploymentConfiguration property: Properties relevant to different deployment types. + * + * @param deploymentConfiguration the deploymentConfiguration value to set. + * @return the BatchDeploymentProperties object itself. + */ + public BatchDeploymentProperties withDeploymentConfiguration(BatchDeploymentConfiguration deploymentConfiguration) { + this.deploymentConfiguration = deploymentConfiguration; + return this; + } + /** * Get the errorThreshold property: Error threshold, if the error count for the entire input goes above this value, * the batch inference will be aborted. Range is [-1, int.MaxValue]. For FileDataset, this value is the count of @@ -353,6 +379,9 @@ public BatchDeploymentProperties withProperties(Map properties) @Override public void validate() { super.validate(); + if (deploymentConfiguration() != null) { + deploymentConfiguration().validate(); + } if (model() != null) { model().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java index 00170d2cfd23d..8984c14d42c02 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java @@ -120,11 +120,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The BatchEndpoint definition stages. */ interface DefinitionStages { /** The first stage of the BatchEndpoint definition. */ interface Blank extends WithLocation { } + /** The stage of the BatchEndpoint definition allowing to specify location. */ interface WithLocation { /** @@ -143,6 +145,7 @@ interface WithLocation { */ WithParentResource withRegion(String location); } + /** The stage of the BatchEndpoint definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -154,6 +157,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the BatchEndpoint definition allowing to specify properties. */ interface WithProperties { /** @@ -164,6 +168,7 @@ interface WithProperties { */ WithCreate withProperties(BatchEndpointProperties properties); } + /** * The stage of the BatchEndpoint definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -188,6 +193,7 @@ interface WithCreate */ BatchEndpoint create(Context context); } + /** The stage of the BatchEndpoint definition allowing to specify tags. */ interface WithTags { /** @@ -198,6 +204,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the BatchEndpoint definition allowing to specify identity. */ interface WithIdentity { /** @@ -209,6 +216,7 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the BatchEndpoint definition allowing to specify kind. */ interface WithKind { /** @@ -221,6 +229,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the BatchEndpoint definition allowing to specify sku. */ interface WithSku { /** @@ -232,6 +241,7 @@ interface WithSku { WithCreate withSku(Sku sku); } } + /** * Begins update for the BatchEndpoint resource. * @@ -256,6 +266,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { */ BatchEndpoint apply(Context context); } + /** The BatchEndpoint update stages. */ interface UpdateStages { /** The stage of the BatchEndpoint update allowing to specify tags. */ @@ -268,6 +279,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the BatchEndpoint update allowing to specify identity. */ interface WithIdentity { /** @@ -280,6 +292,7 @@ interface WithIdentity { Update withIdentity(PartialManagedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java index 91f737a4bd0fc..72dc758424900 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java @@ -14,7 +14,7 @@ @Fluent public final class BatchEndpointProperties extends EndpointPropertiesBaseInner { /* - * Default values for Batch Endpoint + * Default values for Batch Endpoint. */ @JsonProperty(value = "defaults") private BatchEndpointDefaults defaults; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java new file mode 100644 index 0000000000000..e93de5dbfaa2c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Properties for a Batch Pipeline Component Deployment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentConfigurationType") +@JsonTypeName("PipelineComponent") +@Fluent +public final class BatchPipelineComponentDeploymentConfiguration extends BatchDeploymentConfiguration { + /* + * The ARM id of the component to be run. + */ + @JsonProperty(value = "componentId") + private IdAssetReference componentId; + + /* + * The description which will be applied to the job. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Run-time settings for the pipeline job. + */ + @JsonProperty(value = "settings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; + + /* + * The tags which will be applied to the job. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of BatchPipelineComponentDeploymentConfiguration class. */ + public BatchPipelineComponentDeploymentConfiguration() { + } + + /** + * Get the componentId property: The ARM id of the component to be run. + * + * @return the componentId value. + */ + public IdAssetReference componentId() { + return this.componentId; + } + + /** + * Set the componentId property: The ARM id of the component to be run. + * + * @param componentId the componentId value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withComponentId(IdAssetReference componentId) { + this.componentId = componentId; + return this; + } + + /** + * Get the description property: The description which will be applied to the job. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description which will be applied to the job. + * + * @param description the description value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the settings property: Run-time settings for the pipeline job. + * + * @return the settings value. + */ + public Map settings() { + return this.settings; + } + + /** + * Set the settings property: Run-time settings for the pipeline job. + * + * @param settings the settings value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withSettings(Map settings) { + this.settings = settings; + return this; + } + + /** + * Get the tags property: The tags which will be applied to the job. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags which will be applied to the job. + * + * @param tags the tags value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (componentId() != null) { + componentId().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java new file mode 100644 index 0000000000000..512afe21f6899 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BindOptions model. */ +@Fluent +public final class BindOptions { + /* + * Type of Bind Option + */ + @JsonProperty(value = "propagation") + private String propagation; + + /* + * Indicate whether to create host path. + */ + @JsonProperty(value = "createHostPath") + private Boolean createHostPath; + + /* + * Mention the selinux options. + */ + @JsonProperty(value = "selinux") + private String selinux; + + /** Creates an instance of BindOptions class. */ + public BindOptions() { + } + + /** + * Get the propagation property: Type of Bind Option. + * + * @return the propagation value. + */ + public String propagation() { + return this.propagation; + } + + /** + * Set the propagation property: Type of Bind Option. + * + * @param propagation the propagation value to set. + * @return the BindOptions object itself. + */ + public BindOptions withPropagation(String propagation) { + this.propagation = propagation; + return this; + } + + /** + * Get the createHostPath property: Indicate whether to create host path. + * + * @return the createHostPath value. + */ + public Boolean createHostPath() { + return this.createHostPath; + } + + /** + * Set the createHostPath property: Indicate whether to create host path. + * + * @param createHostPath the createHostPath value to set. + * @return the BindOptions object itself. + */ + public BindOptions withCreateHostPath(Boolean createHostPath) { + this.createHostPath = createHostPath; + return this; + } + + /** + * Get the selinux property: Mention the selinux options. + * + * @return the selinux value. + */ + public String selinux() { + return this.selinux; + } + + /** + * Set the selinux property: Mention the selinux options. + * + * @param selinux the selinux value to set. + * @return the BindOptions object itself. + */ + public BindOptions withSelinux(String selinux) { + this.selinux = selinux; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java new file mode 100644 index 0000000000000..d3212ccdf7469 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobReferenceForConsumptionDto model. */ +@Fluent +public final class BlobReferenceForConsumptionDto { + /* + * Blob URI path for client to upload data. + * Example: https://blob.windows.core.net/Container/Path + */ + @JsonProperty(value = "blobUri") + private String blobUri; + + /* + * Credential info to access storage account + */ + @JsonProperty(value = "credential") + private PendingUploadCredentialDto credential; + + /* + * Arm ID of the storage account to use + */ + @JsonProperty(value = "storageAccountArmId") + private String storageAccountArmId; + + /** Creates an instance of BlobReferenceForConsumptionDto class. */ + public BlobReferenceForConsumptionDto() { + } + + /** + * Get the blobUri property: Blob URI path for client to upload data. Example: + * https://blob.windows.core.net/Container/Path. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: Blob URI path for client to upload data. Example: + * https://blob.windows.core.net/Container/Path. + * + * @param blobUri the blobUri value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Get the credential property: Credential info to access storage account. + * + * @return the credential value. + */ + public PendingUploadCredentialDto credential() { + return this.credential; + } + + /** + * Set the credential property: Credential info to access storage account. + * + * @param credential the credential value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withCredential(PendingUploadCredentialDto credential) { + this.credential = credential; + return this; + } + + /** + * Get the storageAccountArmId property: Arm ID of the storage account to use. + * + * @return the storageAccountArmId value. + */ + public String storageAccountArmId() { + return this.storageAccountArmId; + } + + /** + * Set the storageAccountArmId property: Arm ID of the storage account to use. + * + * @param storageAccountArmId the storageAccountArmId value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withStorageAccountArmId(String storageAccountArmId) { + this.storageAccountArmId = storageAccountArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credential() != null) { + credential().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java new file mode 100644 index 0000000000000..0b6f18dfc3975 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CategoricalDataDriftMetric. */ +public final class CategoricalDataDriftMetric extends ExpandableStringEnum { + /** Static value JensenShannonDistance for CategoricalDataDriftMetric. */ + public static final CategoricalDataDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** Static value PopulationStabilityIndex for CategoricalDataDriftMetric. */ + public static final CategoricalDataDriftMetric POPULATION_STABILITY_INDEX = fromString("PopulationStabilityIndex"); + + /** Static value PearsonsChiSquaredTest for CategoricalDataDriftMetric. */ + public static final CategoricalDataDriftMetric PEARSONS_CHI_SQUARED_TEST = fromString("PearsonsChiSquaredTest"); + + /** + * Creates a new instance of CategoricalDataDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalDataDriftMetric() { + } + + /** + * Creates or finds a CategoricalDataDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalDataDriftMetric. + */ + @JsonCreator + public static CategoricalDataDriftMetric fromString(String name) { + return fromString(name, CategoricalDataDriftMetric.class); + } + + /** + * Gets known CategoricalDataDriftMetric values. + * + * @return known CategoricalDataDriftMetric values. + */ + public static Collection values() { + return values(CategoricalDataDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java new file mode 100644 index 0000000000000..ecb244af56649 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CategoricalDataDriftMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Categorical") +@Fluent +public final class CategoricalDataDriftMetricThreshold extends DataDriftMetricThresholdBase { + /* + * [Required] The categorical data drift metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private CategoricalDataDriftMetric metric; + + /** Creates an instance of CategoricalDataDriftMetricThreshold class. */ + public CategoricalDataDriftMetricThreshold() { + } + + /** + * Get the metric property: [Required] The categorical data drift metric to calculate. + * + * @return the metric value. + */ + public CategoricalDataDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical data drift metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalDataDriftMetricThreshold object itself. + */ + public CategoricalDataDriftMetricThreshold withMetric(CategoricalDataDriftMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public CategoricalDataDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model CategoricalDataDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalDataDriftMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java new file mode 100644 index 0000000000000..ef97928b23496 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CategoricalDataQualityMetric. */ +public final class CategoricalDataQualityMetric extends ExpandableStringEnum { + /** Static value NullValueRate for CategoricalDataQualityMetric. */ + public static final CategoricalDataQualityMetric NULL_VALUE_RATE = fromString("NullValueRate"); + + /** Static value DataTypeErrorRate for CategoricalDataQualityMetric. */ + public static final CategoricalDataQualityMetric DATA_TYPE_ERROR_RATE = fromString("DataTypeErrorRate"); + + /** Static value OutOfBoundsRate for CategoricalDataQualityMetric. */ + public static final CategoricalDataQualityMetric OUT_OF_BOUNDS_RATE = fromString("OutOfBoundsRate"); + + /** + * Creates a new instance of CategoricalDataQualityMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalDataQualityMetric() { + } + + /** + * Creates or finds a CategoricalDataQualityMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalDataQualityMetric. + */ + @JsonCreator + public static CategoricalDataQualityMetric fromString(String name) { + return fromString(name, CategoricalDataQualityMetric.class); + } + + /** + * Gets known CategoricalDataQualityMetric values. + * + * @return known CategoricalDataQualityMetric values. + */ + public static Collection values() { + return values(CategoricalDataQualityMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java new file mode 100644 index 0000000000000..9eea95d698906 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CategoricalDataQualityMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Categorical") +@Fluent +public final class CategoricalDataQualityMetricThreshold extends DataQualityMetricThresholdBase { + /* + * [Required] The categorical data quality metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private CategoricalDataQualityMetric metric; + + /** Creates an instance of CategoricalDataQualityMetricThreshold class. */ + public CategoricalDataQualityMetricThreshold() { + } + + /** + * Get the metric property: [Required] The categorical data quality metric to calculate. + * + * @return the metric value. + */ + public CategoricalDataQualityMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical data quality metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalDataQualityMetricThreshold object itself. + */ + public CategoricalDataQualityMetricThreshold withMetric(CategoricalDataQualityMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public CategoricalDataQualityMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model CategoricalDataQualityMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalDataQualityMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java new file mode 100644 index 0000000000000..c9c3c52d73d35 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CategoricalPredictionDriftMetric. */ +public final class CategoricalPredictionDriftMetric extends ExpandableStringEnum { + /** Static value JensenShannonDistance for CategoricalPredictionDriftMetric. */ + public static final CategoricalPredictionDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** Static value PopulationStabilityIndex for CategoricalPredictionDriftMetric. */ + public static final CategoricalPredictionDriftMetric POPULATION_STABILITY_INDEX = + fromString("PopulationStabilityIndex"); + + /** Static value PearsonsChiSquaredTest for CategoricalPredictionDriftMetric. */ + public static final CategoricalPredictionDriftMetric PEARSONS_CHI_SQUARED_TEST = + fromString("PearsonsChiSquaredTest"); + + /** + * Creates a new instance of CategoricalPredictionDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalPredictionDriftMetric() { + } + + /** + * Creates or finds a CategoricalPredictionDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalPredictionDriftMetric. + */ + @JsonCreator + public static CategoricalPredictionDriftMetric fromString(String name) { + return fromString(name, CategoricalPredictionDriftMetric.class); + } + + /** + * Gets known CategoricalPredictionDriftMetric values. + * + * @return known CategoricalPredictionDriftMetric values. + */ + public static Collection values() { + return values(CategoricalPredictionDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java new file mode 100644 index 0000000000000..f99616b75d0dc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CategoricalPredictionDriftMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Categorical") +@Fluent +public final class CategoricalPredictionDriftMetricThreshold extends PredictionDriftMetricThresholdBase { + /* + * [Required] The categorical prediction drift metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private CategoricalPredictionDriftMetric metric; + + /** Creates an instance of CategoricalPredictionDriftMetricThreshold class. */ + public CategoricalPredictionDriftMetricThreshold() { + } + + /** + * Get the metric property: [Required] The categorical prediction drift metric to calculate. + * + * @return the metric value. + */ + public CategoricalPredictionDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical prediction drift metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalPredictionDriftMetricThreshold object itself. + */ + public CategoricalPredictionDriftMetricThreshold withMetric(CategoricalPredictionDriftMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public CategoricalPredictionDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model CategoricalPredictionDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalPredictionDriftMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java index 028afea8b9672..b6f7b1f472744 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java @@ -37,7 +37,7 @@ public final class CertificateDatastoreCredentials extends DatastoreCredentials /* * [Required] Service principal secrets. */ - @JsonProperty(value = "secrets", required = true) + @JsonProperty(value = "secrets") private CertificateDatastoreSecrets secrets; /* diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java index 2a6e376d9a349..62c494a069284 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java @@ -45,6 +45,12 @@ public final class Classification extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private TableFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @@ -58,6 +64,18 @@ public final class Classification extends AutoMLVertical { @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private TableSweepSettings sweepSettings; + /* * Test data input. */ @@ -197,6 +215,26 @@ public Classification withFeaturizationSettings(TableVerticalFeaturizationSettin return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public TableFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the Classification object itself. + */ + public Classification withFixedParameters(TableFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -239,6 +277,48 @@ public Classification withNCrossValidations(NCrossValidations nCrossValidations) return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the Classification object itself. + */ + public Classification withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public TableSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the Classification object itself. + */ + public Classification withSweepSettings(TableSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the testData property: Test data input. * @@ -380,12 +460,21 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } if (nCrossValidations() != null) { nCrossValidations().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (testData() != null) { testData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetric.java new file mode 100644 index 0000000000000..bf95377d2ded0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetric.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClassificationModelPerformanceMetric. */ +public final class ClassificationModelPerformanceMetric + extends ExpandableStringEnum { + /** Static value Accuracy for ClassificationModelPerformanceMetric. */ + public static final ClassificationModelPerformanceMetric ACCURACY = fromString("Accuracy"); + + /** Static value Precision for ClassificationModelPerformanceMetric. */ + public static final ClassificationModelPerformanceMetric PRECISION = fromString("Precision"); + + /** Static value Recall for ClassificationModelPerformanceMetric. */ + public static final ClassificationModelPerformanceMetric RECALL = fromString("Recall"); + + /** + * Creates a new instance of ClassificationModelPerformanceMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClassificationModelPerformanceMetric() { + } + + /** + * Creates or finds a ClassificationModelPerformanceMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClassificationModelPerformanceMetric. + */ + @JsonCreator + public static ClassificationModelPerformanceMetric fromString(String name) { + return fromString(name, ClassificationModelPerformanceMetric.class); + } + + /** + * Gets known ClassificationModelPerformanceMetric values. + * + * @return known ClassificationModelPerformanceMetric values. + */ + public static Collection values() { + return values(ClassificationModelPerformanceMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetricThreshold.java new file mode 100644 index 0000000000000..f859d535b2700 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModelPerformanceMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The ClassificationModelPerformanceMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "modelType") +@JsonTypeName("Classification") +@Fluent +public final class ClassificationModelPerformanceMetricThreshold extends ModelPerformanceMetricThresholdBase { + /* + * [Required] The classification model performance to calculate. + */ + @JsonProperty(value = "metric", required = true) + private ClassificationModelPerformanceMetric metric; + + /** Creates an instance of ClassificationModelPerformanceMetricThreshold class. */ + public ClassificationModelPerformanceMetricThreshold() { + } + + /** + * Get the metric property: [Required] The classification model performance to calculate. + * + * @return the metric value. + */ + public ClassificationModelPerformanceMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The classification model performance to calculate. + * + * @param metric the metric value to set. + * @return the ClassificationModelPerformanceMetricThreshold object itself. + */ + public ClassificationModelPerformanceMetricThreshold withMetric(ClassificationModelPerformanceMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public ClassificationModelPerformanceMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model ClassificationModelPerformanceMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClassificationModelPerformanceMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java index bd667f5bbbc4b..baefcb851051c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java @@ -119,6 +119,13 @@ public ClassificationTrainingSettings withStackEnsembleSettings(StackEnsembleSet return this; } + /** {@inheritDoc} */ + @Override + public ClassificationTrainingSettings withTrainingMode(TrainingMode trainingMode) { + super.withTrainingMode(trainingMode); + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CocoExportSummary.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CocoExportSummary.java new file mode 100644 index 0000000000000..60c0b36ecae0b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CocoExportSummary.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CocoExportSummary model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "format") +@JsonTypeName("Coco") +@Immutable +public final class CocoExportSummary extends ExportSummaryInner { + /* + * The container name to which the labels will be exported. + */ + @JsonProperty(value = "containerName", access = JsonProperty.Access.WRITE_ONLY) + private String containerName; + + /* + * The output path where the labels will be exported. + */ + @JsonProperty(value = "snapshotPath", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotPath; + + /** Creates an instance of CocoExportSummary class. */ + public CocoExportSummary() { + } + + /** + * Get the containerName property: The container name to which the labels will be exported. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Get the snapshotPath property: The output path where the labels will be exported. + * + * @return the snapshotPath value. + */ + public String snapshotPath() { + return this.snapshotPath; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java index 3d41404e0fc47..95684db71a655 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java @@ -66,22 +66,25 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The CodeContainer definition stages. */ interface DefinitionStages { /** The first stage of the CodeContainer definition. */ interface Blank extends WithParentResource { } + /** The stage of the CodeContainer definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. + * Specifies resourceGroupName, registryName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } + /** The stage of the CodeContainer definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(CodeContainerProperties properties); } + /** * The stage of the CodeContainer definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { CodeContainer create(Context context); } } + /** * Begins update for the CodeContainer resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ CodeContainer apply(Context context); } + /** The CodeContainer update stages. */ interface UpdateStages { /** The stage of the CodeContainer update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(CodeContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java index 9f59aab192f14..99fb7112a2c90 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java @@ -5,15 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Container for code asset versions. */ @Fluent public final class CodeContainerProperties extends AssetContainer { + /* + * Provisioning state for the code container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of CodeContainerProperties class. */ public CodeContainerProperties() { } + /** + * Get the provisioningState property: Provisioning state for the code container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + /** {@inheritDoc} */ @Override public CodeContainerProperties withIsArchived(Boolean isArchived) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java index ed9bae7d57a0e..c7e8f7eedd4b1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; /** Resource collection API of CodeContainers. */ public interface CodeContainers { @@ -91,55 +92,32 @@ Response getWithResponse( CodeContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - CodeContainer getById(String id); - - /** - * Get container. + * Create or update container. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, CodeContainerInner body, Context context); /** - * Delete container. + * Create or update container. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CodeContainer resource. - * - * @param name resource name. - * @return the first stage of the new CodeContainer definition. + * @return azure Resource Manager resource envelope. */ - CodeContainer.DefinitionStages.Blank define(String name); + CodeContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, CodeContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java index 74b92c620c7c1..179bf300896fd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; @@ -66,23 +67,26 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The CodeVersion definition stages. */ interface DefinitionStages { /** The first stage of the CodeVersion definition. */ interface Blank extends WithParentResource { } + /** The stage of the CodeVersion definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. + * Specifies resourceGroupName, registryName, codeName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. * @return the next definition stage. */ - WithProperties withExistingCode(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingCode(String resourceGroupName, String registryName, String codeName); } + /** The stage of the CodeVersion definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +97,7 @@ interface WithProperties { */ WithCreate withProperties(CodeVersionProperties properties); } + /** * The stage of the CodeVersion definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -114,6 +119,7 @@ interface WithCreate { CodeVersion create(Context context); } } + /** * Begins update for the CodeVersion resource. * @@ -138,6 +144,7 @@ interface Update extends UpdateStages.WithProperties { */ CodeVersion apply(Context context); } + /** The CodeVersion update stages. */ interface UpdateStages { /** The stage of the CodeVersion update allowing to specify properties. */ @@ -151,6 +158,7 @@ interface WithProperties { Update withProperties(CodeVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. * @@ -165,4 +173,28 @@ interface WithProperties { * @return the refreshed resource. */ CodeVersion refresh(Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java index aa9586a3dcee5..89da6ca80bb10 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java @@ -17,6 +17,12 @@ public final class CodeVersionProperties extends AssetBase { @JsonProperty(value = "codeUri") private String codeUri; + /* + * Provisioning state for the code version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of CodeVersionProperties class. */ public CodeVersionProperties() { } @@ -41,6 +47,22 @@ public CodeVersionProperties withCodeUri(String codeUri) { return this; } + /** + * Get the provisioningState property: Provisioning state for the code version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public CodeVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public CodeVersionProperties withIsAnonymous(Boolean isAnonymous) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java index 832a78bf6085d..d5b03262a9449 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; /** Resource collection API of CodeVersions. */ public interface CodeVersions { @@ -32,6 +33,8 @@ public interface CodeVersions { * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -45,6 +48,8 @@ PagedIterable list( String orderBy, Integer top, String skip, + String hash, + String hashVersion, Context context); /** @@ -107,55 +112,78 @@ Response getWithResponse( CodeVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. + * Create or update version. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - CodeVersion getById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + CodeVersionInner body, + Context context); /** - * Get version. + * Create or update version. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + CodeVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body); /** - * Delete version. + * Generate a storage location and credential for the client to upload a code asset to. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. */ - void deleteById(String id); + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + PendingUploadRequestDto body, + Context context); /** - * Delete version. + * Generate a storage location and credential for the client to upload a code asset to. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CodeVersion resource. - * - * @param name resource name. - * @return the first stage of the new CodeVersion definition. + * @return the response. */ - CodeVersion.DefinitionStages.Blank define(String name); + PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java new file mode 100644 index 0000000000000..436915f91529e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Collection model. */ +@Fluent +public final class Collection { + /* + * The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint + * identity to auth. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Enable or disable data collection. + */ + @JsonProperty(value = "dataCollectionMode") + private DataCollectionMode dataCollectionMode; + + /* + * The data asset arm resource id. Client side will ensure data asset is pointing to the blob storage, and backend + * will collect data to the blob storage. + */ + @JsonProperty(value = "dataId") + private String dataId; + + /* + * The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default. + */ + @JsonProperty(value = "samplingRate") + private Double samplingRate; + + /** Creates an instance of Collection class. */ + public Collection() { + } + + /** + * Get the clientId property: The msi client id used to collect logging to blob storage. If it's null,backend will + * pick a registered endpoint identity to auth. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The msi client id used to collect logging to blob storage. If it's null,backend will + * pick a registered endpoint identity to auth. + * + * @param clientId the clientId value to set. + * @return the Collection object itself. + */ + public Collection withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the dataCollectionMode property: Enable or disable data collection. + * + * @return the dataCollectionMode value. + */ + public DataCollectionMode dataCollectionMode() { + return this.dataCollectionMode; + } + + /** + * Set the dataCollectionMode property: Enable or disable data collection. + * + * @param dataCollectionMode the dataCollectionMode value to set. + * @return the Collection object itself. + */ + public Collection withDataCollectionMode(DataCollectionMode dataCollectionMode) { + this.dataCollectionMode = dataCollectionMode; + return this; + } + + /** + * Get the dataId property: The data asset arm resource id. Client side will ensure data asset is pointing to the + * blob storage, and backend will collect data to the blob storage. + * + * @return the dataId value. + */ + public String dataId() { + return this.dataId; + } + + /** + * Set the dataId property: The data asset arm resource id. Client side will ensure data asset is pointing to the + * blob storage, and backend will collect data to the blob storage. + * + * @param dataId the dataId value to set. + * @return the Collection object itself. + */ + public Collection withDataId(String dataId) { + this.dataId = dataId; + return this; + } + + /** + * Get the samplingRate property: The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data + * by default. + * + * @return the samplingRate value. + */ + public Double samplingRate() { + return this.samplingRate; + } + + /** + * Set the samplingRate property: The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data + * by default. + * + * @param samplingRate the samplingRate value to set. + * @return the Collection object itself. + */ + public Collection withSamplingRate(Double samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java index f7f423aed984f..5ec0e67dbe9d8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java @@ -17,6 +17,12 @@ @JsonTypeName("Command") @Fluent public final class CommandJob extends JobBaseProperties { + /* + * Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + */ + @JsonProperty(value = "autologgerSettings") + private AutologgerSettings autologgerSettings; + /* * ARM resource ID of the code asset. */ @@ -30,7 +36,7 @@ public final class CommandJob extends JobBaseProperties { private String command; /* - * Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + * Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. */ @JsonProperty(value = "distribution") private DistributionConfiguration distribution; @@ -74,6 +80,12 @@ public final class CommandJob extends JobBaseProperties { @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) private Object parameters; + /* + * Queue settings for the job + */ + @JsonProperty(value = "queueSettings") + private QueueSettings queueSettings; + /* * Compute Resource configuration for the job. */ @@ -84,6 +96,28 @@ public final class CommandJob extends JobBaseProperties { public CommandJob() { } + /** + * Get the autologgerSettings property: Distribution configuration of the job. If set, this should be one of Mpi, + * Tensorflow, PyTorch, or null. + * + * @return the autologgerSettings value. + */ + public AutologgerSettings autologgerSettings() { + return this.autologgerSettings; + } + + /** + * Set the autologgerSettings property: Distribution configuration of the job. If set, this should be one of Mpi, + * Tensorflow, PyTorch, or null. + * + * @param autologgerSettings the autologgerSettings value to set. + * @return the CommandJob object itself. + */ + public CommandJob withAutologgerSettings(AutologgerSettings autologgerSettings) { + this.autologgerSettings = autologgerSettings; + return this; + } + /** * Get the codeId property: ARM resource ID of the code asset. * @@ -126,7 +160,7 @@ public CommandJob withCommand(String command) { /** * Get the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, - * Tensorflow, PyTorch, or null. + * Tensorflow, PyTorch, Ray, or null. * * @return the distribution value. */ @@ -136,7 +170,7 @@ public DistributionConfiguration distribution() { /** * Set the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, - * Tensorflow, PyTorch, or null. + * Tensorflow, PyTorch, Ray, or null. * * @param distribution the distribution value to set. * @return the CommandJob object itself. @@ -255,6 +289,26 @@ public Object parameters() { return this.parameters; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the CommandJob object itself. + */ + public CommandJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the resources property: Compute Resource configuration for the job. * @@ -317,6 +371,20 @@ public CommandJob withIsArchived(Boolean isArchived) { return this; } + /** {@inheritDoc} */ + @Override + public CommandJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public CommandJob withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + /** {@inheritDoc} */ @Override public CommandJob withServices(Map services) { @@ -353,6 +421,9 @@ public CommandJob withTags(Map tags) { @Override public void validate() { super.validate(); + if (autologgerSettings() != null) { + autologgerSettings().validate(); + } if (command() == null) { throw LOGGER .logExceptionAsError( @@ -389,6 +460,9 @@ public void validate() { } }); } + if (queueSettings() != null) { + queueSettings().validate(); + } if (resources() != null) { resources().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java index 2db458e03fb13..3a2de56f97d3d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java @@ -66,22 +66,25 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The ComponentContainer definition stages. */ interface DefinitionStages { /** The first stage of the ComponentContainer definition. */ interface Blank extends WithParentResource { } + /** The stage of the ComponentContainer definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. + * Specifies resourceGroupName, registryName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } + /** The stage of the ComponentContainer definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(ComponentContainerProperties properties); } + /** * The stage of the ComponentContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { ComponentContainer create(Context context); } } + /** * Begins update for the ComponentContainer resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ ComponentContainer apply(Context context); } + /** The ComponentContainer update stages. */ interface UpdateStages { /** The stage of the ComponentContainer update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(ComponentContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java index 514b48b0968f2..951a246c2ccda 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** @@ -13,10 +14,25 @@ */ @Fluent public final class ComponentContainerProperties extends AssetContainer { + /* + * Provisioning state for the component container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of ComponentContainerProperties class. */ public ComponentContainerProperties() { } + /** + * Get the provisioningState property: Provisioning state for the component container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + /** {@inheritDoc} */ @Override public ComponentContainerProperties withIsArchived(Boolean isArchived) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java index 4339a456fddc1..a7ac6a798ab35 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; /** Resource collection API of ComponentContainers. */ public interface ComponentContainers { @@ -93,55 +94,33 @@ Response getWithResponse( ComponentContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - ComponentContainer getById(String id); - - /** - * Get container. + * Create or update container. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, ComponentContainerInner body, Context context); /** - * Delete container. + * Create or update container. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ComponentContainer resource. - * - * @param name resource name. - * @return the first stage of the new ComponentContainer definition. + * @return azure Resource Manager resource envelope. */ - ComponentContainer.DefinitionStages.Blank define(String name); + ComponentContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, ComponentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java index 3b45a1f1eb5e9..b0f79fc8e0b17 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java @@ -66,23 +66,26 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The ComponentVersion definition stages. */ interface DefinitionStages { /** The first stage of the ComponentVersion definition. */ interface Blank extends WithParentResource { } + /** The stage of the ComponentVersion definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. + * Specifies resourceGroupName, registryName, componentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. * @return the next definition stage. */ - WithProperties withExistingComponent(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingComponent(String resourceGroupName, String registryName, String componentName); } + /** The stage of the ComponentVersion definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +96,7 @@ interface WithProperties { */ WithCreate withProperties(ComponentVersionProperties properties); } + /** * The stage of the ComponentVersion definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -114,6 +118,7 @@ interface WithCreate { ComponentVersion create(Context context); } } + /** * Begins update for the ComponentVersion resource. * @@ -138,6 +143,7 @@ interface Update extends UpdateStages.WithProperties { */ ComponentVersion apply(Context context); } + /** The ComponentVersion update stages. */ interface UpdateStages { /** The stage of the ComponentVersion update allowing to specify properties. */ @@ -151,6 +157,7 @@ interface WithProperties { Update withProperties(ComponentVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java index 0dde26bb4437f..106a5b2ec3ef7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java @@ -18,6 +18,18 @@ public final class ComponentVersionProperties extends AssetBase { @JsonProperty(value = "componentSpec") private Object componentSpec; + /* + * Provisioning state for the component version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /* + * Stage in the component lifecycle + */ + @JsonProperty(value = "stage") + private String stage; + /** Creates an instance of ComponentVersionProperties class. */ public ComponentVersionProperties() { } @@ -44,6 +56,42 @@ public ComponentVersionProperties withComponentSpec(Object componentSpec) { return this; } + /** + * Get the provisioningState property: Provisioning state for the component version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Stage in the component lifecycle. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the component lifecycle. + * + * @param stage the stage value to set. + * @return the ComponentVersionProperties object itself. + */ + public ComponentVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public ComponentVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public ComponentVersionProperties withIsAnonymous(Boolean isAnonymous) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java index ee49889d97588..965f2c835e01c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; /** Resource collection API of ComponentVersions. */ public interface ComponentVersions { @@ -33,6 +34,7 @@ public interface ComponentVersions { * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Component stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -47,6 +49,7 @@ PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context); /** @@ -109,55 +112,40 @@ Response getWithResponse( ComponentVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - ComponentVersion getById(String id); - - /** - * Get version. + * Create or update version. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete version. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + ComponentVersionInner body, + Context context); /** - * Delete version. + * Create or update version. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ComponentVersion resource. - * - * @param name resource name. - * @return the first stage of the new ComponentVersion definition. + * @return azure Resource Manager resource envelope. */ - ComponentVersion.DefinitionStages.Blank define(String name); + ComponentVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAutologgerSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAutologgerSettings.java new file mode 100644 index 0000000000000..2079ea6bc6f1b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAutologgerSettings.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies settings for autologger. */ +@Fluent +public final class ComputeInstanceAutologgerSettings { + /* + * Indicates whether mlflow autologger is enabled for notebooks. + */ + @JsonProperty(value = "mlflowAutologger") + private MlflowAutologger mlflowAutologger; + + /** Creates an instance of ComputeInstanceAutologgerSettings class. */ + public ComputeInstanceAutologgerSettings() { + } + + /** + * Get the mlflowAutologger property: Indicates whether mlflow autologger is enabled for notebooks. + * + * @return the mlflowAutologger value. + */ + public MlflowAutologger mlflowAutologger() { + return this.mlflowAutologger; + } + + /** + * Set the mlflowAutologger property: Indicates whether mlflow autologger is enabled for notebooks. + * + * @param mlflowAutologger the mlflowAutologger value to set. + * @return the ComputeInstanceAutologgerSettings object itself. + */ + public ComputeInstanceAutologgerSettings withMlflowAutologger(MlflowAutologger mlflowAutologger) { + this.mlflowAutologger = mlflowAutologger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java index c5332ebf01e8b..9e00b620cb52c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java @@ -34,12 +34,30 @@ public final class ComputeInstanceProperties { @JsonProperty(value = "applicationSharingPolicy") private ApplicationSharingPolicy applicationSharingPolicy; + /* + * Specifies settings for autologger. + */ + @JsonProperty(value = "autologgerSettings") + private ComputeInstanceAutologgerSettings autologgerSettings; + /* * Specifies policy and settings for SSH access. */ @JsonProperty(value = "sshSettings") private ComputeInstanceSshSettings sshSettings; + /* + * List of Custom Services added to the compute. + */ + @JsonProperty(value = "customServices") + private List customServices; + + /* + * Returns metadata about the operating system image for this compute instance. + */ + @JsonProperty(value = "osImageMetadata", access = JsonProperty.Access.WRITE_ONLY) + private ImageMetadata osImageMetadata; + /* * Describes all connectivity endpoints available for this ComputeInstance. */ @@ -80,6 +98,23 @@ public final class ComputeInstanceProperties { @JsonProperty(value = "computeInstanceAuthorizationType") private ComputeInstanceAuthorizationType computeInstanceAuthorizationType; + /* + * Enable Auto OS Patching. + * + * Enable Auto OS Patching. Possible values are: true, false. + */ + @JsonProperty(value = "enableOSPatching") + private Boolean enableOSPatching; + + /* + * Release quota if compute instance stopped. + * + * Release quota if compute instance stopped. Possible values are: true - release quota if compute instance + * stopped. false - don't release quota when compute instance stopped. + */ + @JsonProperty(value = "releaseQuotaOnStop") + private Boolean releaseQuotaOnStop; + /* * Settings for a personal compute instance. */ @@ -101,9 +136,16 @@ public final class ComputeInstanceProperties { /* * The list of schedules to be applied on the computes. */ - @JsonProperty(value = "schedules", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "schedules") private ComputeSchedules schedules; + /* + * Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 + * min, maximum is 3 days. + */ + @JsonProperty(value = "idleTimeBeforeShutdown") + private String idleTimeBeforeShutdown; + /* * Enable node public IP. * @@ -210,6 +252,26 @@ public ComputeInstanceProperties withApplicationSharingPolicy(ApplicationSharing return this; } + /** + * Get the autologgerSettings property: Specifies settings for autologger. + * + * @return the autologgerSettings value. + */ + public ComputeInstanceAutologgerSettings autologgerSettings() { + return this.autologgerSettings; + } + + /** + * Set the autologgerSettings property: Specifies settings for autologger. + * + * @param autologgerSettings the autologgerSettings value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withAutologgerSettings(ComputeInstanceAutologgerSettings autologgerSettings) { + this.autologgerSettings = autologgerSettings; + return this; + } + /** * Get the sshSettings property: Specifies policy and settings for SSH access. * @@ -230,6 +292,35 @@ public ComputeInstanceProperties withSshSettings(ComputeInstanceSshSettings sshS return this; } + /** + * Get the customServices property: List of Custom Services added to the compute. + * + * @return the customServices value. + */ + public List customServices() { + return this.customServices; + } + + /** + * Set the customServices property: List of Custom Services added to the compute. + * + * @param customServices the customServices value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withCustomServices(List customServices) { + this.customServices = customServices; + return this; + } + + /** + * Get the osImageMetadata property: Returns metadata about the operating system image for this compute instance. + * + * @return the osImageMetadata value. + */ + public ImageMetadata osImageMetadata() { + return this.osImageMetadata; + } + /** * Get the connectivityEndpoints property: Describes all connectivity endpoints available for this ComputeInstance. * @@ -302,6 +393,56 @@ public ComputeInstanceProperties withComputeInstanceAuthorizationType( return this; } + /** + * Get the enableOSPatching property: Enable Auto OS Patching. + * + *

Enable Auto OS Patching. Possible values are: true, false. + * + * @return the enableOSPatching value. + */ + public Boolean enableOSPatching() { + return this.enableOSPatching; + } + + /** + * Set the enableOSPatching property: Enable Auto OS Patching. + * + *

Enable Auto OS Patching. Possible values are: true, false. + * + * @param enableOSPatching the enableOSPatching value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withEnableOSPatching(Boolean enableOSPatching) { + this.enableOSPatching = enableOSPatching; + return this; + } + + /** + * Get the releaseQuotaOnStop property: Release quota if compute instance stopped. + * + *

Release quota if compute instance stopped. Possible values are: true - release quota if compute instance + * stopped. false - don't release quota when compute instance stopped. + * + * @return the releaseQuotaOnStop value. + */ + public Boolean releaseQuotaOnStop() { + return this.releaseQuotaOnStop; + } + + /** + * Set the releaseQuotaOnStop property: Release quota if compute instance stopped. + * + *

Release quota if compute instance stopped. Possible values are: true - release quota if compute instance + * stopped. false - don't release quota when compute instance stopped. + * + * @param releaseQuotaOnStop the releaseQuotaOnStop value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withReleaseQuotaOnStop(Boolean releaseQuotaOnStop) { + this.releaseQuotaOnStop = releaseQuotaOnStop; + return this; + } + /** * Get the personalComputeInstanceSettings property: Settings for a personal compute instance. * @@ -361,6 +502,39 @@ public ComputeSchedules schedules() { return this.schedules; } + /** + * Set the schedules property: The list of schedules to be applied on the computes. + * + * @param schedules the schedules value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withSchedules(ComputeSchedules schedules) { + this.schedules = schedules; + return this; + } + + /** + * Get the idleTimeBeforeShutdown property: Stops compute instance after user defined period of inactivity. Time is + * defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + * + * @return the idleTimeBeforeShutdown value. + */ + public String idleTimeBeforeShutdown() { + return this.idleTimeBeforeShutdown; + } + + /** + * Set the idleTimeBeforeShutdown property: Stops compute instance after user defined period of inactivity. Time is + * defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + * + * @param idleTimeBeforeShutdown the idleTimeBeforeShutdown value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withIdleTimeBeforeShutdown(String idleTimeBeforeShutdown) { + this.idleTimeBeforeShutdown = idleTimeBeforeShutdown; + return this; + } + /** * Get the enableNodePublicIp property: Enable node public IP. * @@ -434,9 +608,18 @@ public void validate() { if (subnet() != null) { subnet().validate(); } + if (autologgerSettings() != null) { + autologgerSettings().validate(); + } if (sshSettings() != null) { sshSettings().validate(); } + if (customServices() != null) { + customServices().forEach(e -> e.validate()); + } + if (osImageMetadata() != null) { + osImageMetadata().validate(); + } if (connectivityEndpoints() != null) { connectivityEndpoints().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java index 7e62436e09e71..a2b62c7ae20e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java @@ -25,6 +25,9 @@ public final class ComputeInstanceState extends ExpandableStringEnum { /** Static value Start for ComputePowerAction. */ public static final ComputePowerAction START = fromString("Start"); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java index 2a15fb09ae3ff..b4977e56979d3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java @@ -10,6 +10,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; +import java.util.List; import java.util.Map; /** An immutable client-side representation of ComputeResource. */ @@ -109,11 +110,13 @@ public interface ComputeResource { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The ComputeResource definition stages. */ interface DefinitionStages { /** The first stage of the ComputeResource definition. */ interface Blank extends WithParentResource { } + /** The stage of the ComputeResource definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -125,6 +128,7 @@ interface WithParentResource { */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the ComputeResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -150,6 +154,7 @@ interface WithCreate */ ComputeResource create(Context context); } + /** The stage of the ComputeResource definition allowing to specify location. */ interface WithLocation { /** @@ -168,6 +173,7 @@ interface WithLocation { */ WithCreate withRegion(String location); } + /** The stage of the ComputeResource definition allowing to specify tags. */ interface WithTags { /** @@ -178,6 +184,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the ComputeResource definition allowing to specify identity. */ interface WithIdentity { /** @@ -188,6 +195,7 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the ComputeResource definition allowing to specify sku. */ interface WithSku { /** @@ -198,6 +206,7 @@ interface WithSku { */ WithCreate withSku(Sku sku); } + /** The stage of the ComputeResource definition allowing to specify properties. */ interface WithProperties { /** @@ -209,6 +218,7 @@ interface WithProperties { WithCreate withProperties(Compute properties); } } + /** * Begins update for the ComputeResource resource. * @@ -233,6 +243,7 @@ interface Update extends UpdateStages.WithProperties { */ ComputeResource apply(Context context); } + /** The ComputeResource update stages. */ interface UpdateStages { /** The stage of the ComputeResource update allowing to specify properties. */ @@ -246,6 +257,7 @@ interface WithProperties { Update withProperties(ScaleSettingsInformation properties); } } + /** * Refreshes the resource to sync with Azure. * @@ -261,6 +273,28 @@ interface WithProperties { */ ComputeResource refresh(Context context); + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param customServices New list of Custom Services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response updateCustomServicesWithResponse(List customServices, Context context); + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateCustomServices(List customServices); + /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. * @@ -357,4 +391,47 @@ interface WithProperties { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void restart(Context context); + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response updateIdleShutdownSettingWithResponse(IdleShutdownSetting parameters, Context context); + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateIdleShutdownSetting(IdleShutdownSetting parameters); + + /** + * Updates the size of a Compute Instance. + * + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resize(ResizeSchema parameters); + + /** + * Updates the size of a Compute Instance. + * + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resize(ResizeSchema parameters, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java new file mode 100644 index 0000000000000..7501ed074cf24 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ComputeRuntimeDto model. */ +@Fluent +public final class ComputeRuntimeDto { + /* + * The sparkRuntimeVersion property. + */ + @JsonProperty(value = "sparkRuntimeVersion") + private String sparkRuntimeVersion; + + /** Creates an instance of ComputeRuntimeDto class. */ + public ComputeRuntimeDto() { + } + + /** + * Get the sparkRuntimeVersion property: The sparkRuntimeVersion property. + * + * @return the sparkRuntimeVersion value. + */ + public String sparkRuntimeVersion() { + return this.sparkRuntimeVersion; + } + + /** + * Set the sparkRuntimeVersion property: The sparkRuntimeVersion property. + * + * @param sparkRuntimeVersion the sparkRuntimeVersion value to set. + * @return the ComputeRuntimeDto object itself. + */ + public ComputeRuntimeDto withSparkRuntimeVersion(String sparkRuntimeVersion) { + this.sparkRuntimeVersion = sparkRuntimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java index 609941e651ab6..e994673dea3a2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java @@ -44,13 +44,13 @@ public final class ComputeStartStopSchedule { * Required if triggerType is Recurrence. */ @JsonProperty(value = "recurrence") - private RecurrenceTrigger recurrence; + private Recurrence recurrence; /* * Required if triggerType is Cron. */ @JsonProperty(value = "cron") - private CronTrigger cron; + private Cron cron; /* * [Deprecated] Not used any more. @@ -145,7 +145,7 @@ public ComputeStartStopSchedule withTriggerType(TriggerType triggerType) { * * @return the recurrence value. */ - public RecurrenceTrigger recurrence() { + public Recurrence recurrence() { return this.recurrence; } @@ -155,7 +155,7 @@ public RecurrenceTrigger recurrence() { * @param recurrence the recurrence value to set. * @return the ComputeStartStopSchedule object itself. */ - public ComputeStartStopSchedule withRecurrence(RecurrenceTrigger recurrence) { + public ComputeStartStopSchedule withRecurrence(Recurrence recurrence) { this.recurrence = recurrence; return this; } @@ -165,7 +165,7 @@ public ComputeStartStopSchedule withRecurrence(RecurrenceTrigger recurrence) { * * @return the cron value. */ - public CronTrigger cron() { + public Cron cron() { return this.cron; } @@ -175,7 +175,7 @@ public CronTrigger cron() { * @param cron the cron value to set. * @return the ComputeStartStopSchedule object itself. */ - public ComputeStartStopSchedule withCron(CronTrigger cron) { + public ComputeStartStopSchedule withCron(Cron cron) { this.cron = cron; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java index 007d1460f249f..c80833b8dd264 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import java.util.List; /** Resource collection API of Computes. */ public interface Computes { @@ -104,6 +105,40 @@ void delete( UnderlyingResourceAction underlyingResourceAction, Context context); + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response updateCustomServicesWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + List customServices, + Context context); + + /** + * Updates the custom services list. The list of custom services provided shall be overwritten. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param customServices New list of Custom Services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateCustomServices( + String resourceGroupName, String workspaceName, String computeName, List customServices); + /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. * @@ -239,6 +274,96 @@ Response listKeysWithResponse( */ void restart(String resourceGroupName, String workspaceName, String computeName, Context context); + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response updateIdleShutdownSettingWithResponse( + String resourceGroupName, + String workspaceName, + String computeName, + IdleShutdownSetting parameters, + Context context); + + /** + * Updates the idle shutdown setting of a compute instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating idle shutdown setting of specified ComputeInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateIdleShutdownSetting( + String resourceGroupName, String workspaceName, String computeName, IdleShutdownSetting parameters); + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response along with {@link Response}. + */ + Response allowedResizeSizesWithResponse( + String resourceGroupName, String workspaceName, String computeName, Context context); + + /** + * Returns supported virtual machine sizes for resize. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine size operation response. + */ + VirtualMachineSizeListResult allowedResizeSizes(String resourceGroupName, String workspaceName, String computeName); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resize(String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters); + + /** + * Updates the size of a Compute Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param computeName Name of the Azure Machine Learning compute. + * @param parameters The object for updating VM size setting of specified Compute Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resize( + String resourceGroupName, String workspaceName, String computeName, ResizeSchema parameters, Context context); + /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java index 04ac12e98553a..8bad6e210e171 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java @@ -25,6 +25,18 @@ public final class ConnectionAuthType extends ExpandableStringEnum { /** Static value StorageInitializer for ContainerType. */ public static final ContainerType STORAGE_INITIALIZER = fromString("StorageInitializer"); @@ -16,6 +16,9 @@ public final class ContainerType extends ExpandableStringEnum { /** Static value InferenceServer for ContainerType. */ public static final ContainerType INFERENCE_SERVER = fromString("InferenceServer"); + /** Static value ModelDataCollector for ContainerType. */ + public static final ContainerType MODEL_DATA_COLLECTOR = fromString("ModelDataCollector"); + /** * Creates a new instance of ContainerType value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java index 0b05e1cfaf609..1ba950d0f8cf0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java @@ -11,7 +11,7 @@ @Fluent public final class CosmosDbSettings { /* - * The throughput of the collections in cosmosdb database + * The collectionsThroughput property. */ @JsonProperty(value = "collectionsThroughput") private Integer collectionsThroughput; @@ -21,7 +21,7 @@ public CosmosDbSettings() { } /** - * Get the collectionsThroughput property: The throughput of the collections in cosmosdb database. + * Get the collectionsThroughput property: The collectionsThroughput property. * * @return the collectionsThroughput value. */ @@ -30,7 +30,7 @@ public Integer collectionsThroughput() { } /** - * Set the collectionsThroughput property: The throughput of the collections in cosmosdb database. + * Set the collectionsThroughput property: The collectionsThroughput property. * * @param collectionsThroughput the collectionsThroughput value to set. * @return the CosmosDbSettings object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java new file mode 100644 index 0000000000000..e28869577e4ea --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CreateMonitorAction model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +@JsonTypeName("CreateMonitor") +@Fluent +public final class CreateMonitorAction extends ScheduleActionBase { + /* + * [Required] Defines the monitor. + */ + @JsonProperty(value = "monitorDefinition", required = true) + private MonitorDefinition monitorDefinition; + + /** Creates an instance of CreateMonitorAction class. */ + public CreateMonitorAction() { + } + + /** + * Get the monitorDefinition property: [Required] Defines the monitor. + * + * @return the monitorDefinition value. + */ + public MonitorDefinition monitorDefinition() { + return this.monitorDefinition; + } + + /** + * Set the monitorDefinition property: [Required] Defines the monitor. + * + * @param monitorDefinition the monitorDefinition value to set. + * @return the CreateMonitorAction object itself. + */ + public CreateMonitorAction withMonitorDefinition(MonitorDefinition monitorDefinition) { + this.monitorDefinition = monitorDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (monitorDefinition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property monitorDefinition in model CreateMonitorAction")); + } else { + monitorDefinition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateMonitorAction.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java index 7596a8d963da1..49a84fa3a815a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java @@ -25,6 +25,12 @@ public final class CredentialsType extends ExpandableStringEnum /** Static value ServicePrincipal for CredentialsType. */ public static final CredentialsType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + /** Static value KerberosKeytab for CredentialsType. */ + public static final CredentialsType KERBEROS_KEYTAB = fromString("KerberosKeytab"); + + /** Static value KerberosPassword for CredentialsType. */ + public static final CredentialsType KERBEROS_PASSWORD = fromString("KerberosPassword"); + /** * Creates a new instance of CredentialsType value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java new file mode 100644 index 0000000000000..e0be7b771ec00 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The workflow trigger cron for ComputeStartStop schedule type. */ +@Fluent +public final class Cron { + /* + * The start time in yyyy-MM-ddTHH:mm:ss format. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Specifies time zone in which the schedule runs. + * TimeZone should follow Windows time zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + */ + @JsonProperty(value = "expression") + private String expression; + + /** Creates an instance of Cron class. */ + public Cron() { + } + + /** + * Get the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @param startTime the startTime value to set. + * @return the Cron object itself. + */ + public Cron withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time + * zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time + * zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + * + * @param timeZone the timeZone value to set. + * @return the Cron object itself. + */ + public Cron withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the expression property: [Required] Specifies cron expression of schedule. The expression should follow + * NCronTab format. + * + * @return the expression value. + */ + public String expression() { + return this.expression; + } + + /** + * Set the expression property: [Required] Specifies cron expression of schedule. The expression should follow + * NCronTab format. + * + * @param expression the expression value to set. + * @return the Cron object itself. + */ + public Cron withExpression(String expression) { + this.expression = expression; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CsvExportSummary.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CsvExportSummary.java new file mode 100644 index 0000000000000..3c500c994ef48 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CsvExportSummary.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The CsvExportSummary model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "format") +@JsonTypeName("CSV") +@Immutable +public final class CsvExportSummary extends ExportSummaryInner { + /* + * The container name to which the labels will be exported. + */ + @JsonProperty(value = "containerName", access = JsonProperty.Access.WRITE_ONLY) + private String containerName; + + /* + * The output path where the labels will be exported. + */ + @JsonProperty(value = "snapshotPath", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotPath; + + /** Creates an instance of CsvExportSummary class. */ + public CsvExportSummary() { + } + + /** + * Get the containerName property: The container name to which the labels will be exported. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Get the snapshotPath property: The output path where the labels will be exported. + * + * @return the snapshotPath value. + */ + public String snapshotPath() { + return this.snapshotPath; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomInferencingServer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomInferencingServer.java new file mode 100644 index 0000000000000..d1087a0f7630a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomInferencingServer.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Custom inference server configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serverType") +@JsonTypeName("Custom") +@Fluent +public final class CustomInferencingServer extends InferencingServer { + /* + * Inference configuration for custom inferencing. + */ + @JsonProperty(value = "inferenceConfiguration") + private OnlineInferenceConfiguration inferenceConfiguration; + + /** Creates an instance of CustomInferencingServer class. */ + public CustomInferencingServer() { + } + + /** + * Get the inferenceConfiguration property: Inference configuration for custom inferencing. + * + * @return the inferenceConfiguration value. + */ + public OnlineInferenceConfiguration inferenceConfiguration() { + return this.inferenceConfiguration; + } + + /** + * Set the inferenceConfiguration property: Inference configuration for custom inferencing. + * + * @param inferenceConfiguration the inferenceConfiguration value to set. + * @return the CustomInferencingServer object itself. + */ + public CustomInferencingServer withInferenceConfiguration(OnlineInferenceConfiguration inferenceConfiguration) { + this.inferenceConfiguration = inferenceConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (inferenceConfiguration() != null) { + inferenceConfiguration().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java new file mode 100644 index 0000000000000..cbc773bc34f31 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Custom Keys credential object. */ +@Fluent +public final class CustomKeys { + /* + * Dictionary of + */ + @JsonProperty(value = "keys") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map keys; + + /** Creates an instance of CustomKeys class. */ + public CustomKeys() { + } + + /** + * Get the keys property: Dictionary of <string>. + * + * @return the keys value. + */ + public Map keys() { + return this.keys; + } + + /** + * Set the keys property: Dictionary of <string>. + * + * @param keys the keys value to set. + * @return the CustomKeys object itself. + */ + public CustomKeys withKeys(Map keys) { + this.keys = keys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..0db28092cc5d7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** + * Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} as + * Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} Use Metadata + * property bag for ApiVersion and other metadata fields. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("CustomKeys") +@Fluent +public final class CustomKeysWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Custom Keys credential object + */ + @JsonProperty(value = "credentials") + private CustomKeys credentials; + + /** Creates an instance of CustomKeysWorkspaceConnectionProperties class. */ + public CustomKeysWorkspaceConnectionProperties() { + } + + /** + * Get the credentials property: Custom Keys credential object. + * + * @return the credentials value. + */ + public CustomKeys credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Custom Keys credential object. + * + * @param credentials the credentials value to set. + * @return the CustomKeysWorkspaceConnectionProperties object itself. + */ + public CustomKeysWorkspaceConnectionProperties withCredentials(CustomKeys credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomKeysWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomKeysWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomKeysWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomKeysWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java new file mode 100644 index 0000000000000..5c52e2f896033 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomMetricThreshold model. */ +@Fluent +public final class CustomMetricThreshold { + /* + * [Required] The user-defined metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private String metric; + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of CustomMetricThreshold class. */ + public CustomMetricThreshold() { + } + + /** + * Get the metric property: [Required] The user-defined metric to calculate. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The user-defined metric to calculate. + * + * @param metric the metric value to set. + * @return the CustomMetricThreshold object itself. + */ + public CustomMetricThreshold withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the CustomMetricThreshold object itself. + */ + public CustomMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property metric in model CustomMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java index b68ea2621db98..744be98a099bb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("custom_model") @Fluent public final class CustomModelJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class CustomModelJobOutput extends JobOutput { public CustomModelJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the CustomModelJobOutput object itself. + */ + public CustomModelJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the CustomModelJobOutput object itself. + */ + public CustomModelJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the CustomModelJobOutput object itself. + */ + public CustomModelJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public CustomModelJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java new file mode 100644 index 0000000000000..879a1a5613a17 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The CustomMonitoringSignal model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("Custom") +@Fluent +public final class CustomMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] ARM resource ID of the component resource used to calculate the custom metrics. + */ + @JsonProperty(value = "componentId", required = true) + private String componentId; + + /* + * Monitoring assets to take as input. Key is the component input port name, value is the data asset. + */ + @JsonProperty(value = "inputAssets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map inputAssets; + + /* + * Extra component parameters to take as input. Key is the component literal input port name, value is the + * parameter value. + */ + @JsonProperty(value = "inputs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map inputs; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "workspaceConnection", required = true) + private MonitoringWorkspaceConnection workspaceConnection; + + /** Creates an instance of CustomMonitoringSignal class. */ + public CustomMonitoringSignal() { + } + + /** + * Get the componentId property: [Required] ARM resource ID of the component resource used to calculate the custom + * metrics. + * + * @return the componentId value. + */ + public String componentId() { + return this.componentId; + } + + /** + * Set the componentId property: [Required] ARM resource ID of the component resource used to calculate the custom + * metrics. + * + * @param componentId the componentId value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withComponentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Get the inputAssets property: Monitoring assets to take as input. Key is the component input port name, value is + * the data asset. + * + * @return the inputAssets value. + */ + public Map inputAssets() { + return this.inputAssets; + } + + /** + * Set the inputAssets property: Monitoring assets to take as input. Key is the component input port name, value is + * the data asset. + * + * @param inputAssets the inputAssets value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withInputAssets(Map inputAssets) { + this.inputAssets = inputAssets; + return this; + } + + /** + * Get the inputs property: Extra component parameters to take as input. Key is the component literal input port + * name, value is the parameter value. + * + * @return the inputs value. + */ + public Map inputs() { + return this.inputs; + } + + /** + * Set the inputs property: Extra component parameters to take as input. Key is the component literal input port + * name, value is the parameter value. + * + * @param inputs the inputs value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withInputs(Map inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the workspaceConnection property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the workspaceConnection value. + */ + public MonitoringWorkspaceConnection workspaceConnection() { + return this.workspaceConnection; + } + + /** + * Set the workspaceConnection property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param workspaceConnection the workspaceConnection value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withWorkspaceConnection(MonitoringWorkspaceConnection workspaceConnection) { + this.workspaceConnection = workspaceConnection; + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (componentId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property componentId in model CustomMonitoringSignal")); + } + if (inputAssets() != null) { + inputAssets() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (inputs() != null) { + inputs() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model CustomMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (workspaceConnection() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property workspaceConnection in model CustomMonitoringSignal")); + } else { + workspaceConnection().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java new file mode 100644 index 0000000000000..a2534931c6119 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Specifies the custom service configuration. */ +@Fluent +public final class CustomService { + /* + * Name of the Custom Service + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes the Image Specifications + */ + @JsonProperty(value = "image") + private Image image; + + /* + * Environment Variable for the container + */ + @JsonProperty(value = "environmentVariables") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map environmentVariables; + + /* + * Describes the docker settings for the image + */ + @JsonProperty(value = "docker") + private Docker docker; + + /* + * Configuring the endpoints for the container + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * Configuring the volumes for the container + */ + @JsonProperty(value = "volumes") + private List volumes; + + /* + * Specifies the custom service configuration + */ + @JsonIgnore private Map additionalProperties; + + /** Creates an instance of CustomService class. */ + public CustomService() { + } + + /** + * Get the name property: Name of the Custom Service. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Custom Service. + * + * @param name the name value to set. + * @return the CustomService object itself. + */ + public CustomService withName(String name) { + this.name = name; + return this; + } + + /** + * Get the image property: Describes the Image Specifications. + * + * @return the image value. + */ + public Image image() { + return this.image; + } + + /** + * Set the image property: Describes the Image Specifications. + * + * @param image the image value to set. + * @return the CustomService object itself. + */ + public CustomService withImage(Image image) { + this.image = image; + return this; + } + + /** + * Get the environmentVariables property: Environment Variable for the container. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment Variable for the container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the CustomService object itself. + */ + public CustomService withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the docker property: Describes the docker settings for the image. + * + * @return the docker value. + */ + public Docker docker() { + return this.docker; + } + + /** + * Set the docker property: Describes the docker settings for the image. + * + * @param docker the docker value to set. + * @return the CustomService object itself. + */ + public CustomService withDocker(Docker docker) { + this.docker = docker; + return this; + } + + /** + * Get the endpoints property: Configuring the endpoints for the container. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: Configuring the endpoints for the container. + * + * @param endpoints the endpoints value to set. + * @return the CustomService object itself. + */ + public CustomService withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the volumes property: Configuring the volumes for the container. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: Configuring the volumes for the container. + * + * @param volumes the volumes value to set. + * @return the CustomService object itself. + */ + public CustomService withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the additionalProperties property: Specifies the custom service configuration. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Specifies the custom service configuration. + * + * @param additionalProperties the additionalProperties value to set. + * @return the CustomService object itself. + */ + public CustomService withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() != null) { + image().validate(); + } + if (environmentVariables() != null) { + environmentVariables() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (docker() != null) { + docker().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java new file mode 100644 index 0000000000000..11fc5485bca93 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataCollectionMode. */ +public final class DataCollectionMode extends ExpandableStringEnum { + /** Static value Enabled for DataCollectionMode. */ + public static final DataCollectionMode ENABLED = fromString("Enabled"); + + /** Static value Disabled for DataCollectionMode. */ + public static final DataCollectionMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DataCollectionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataCollectionMode() { + } + + /** + * Creates or finds a DataCollectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataCollectionMode. + */ + @JsonCreator + public static DataCollectionMode fromString(String name) { + return fromString(name, DataCollectionMode.class); + } + + /** + * Gets known DataCollectionMode values. + * + * @return known DataCollectionMode values. + */ + public static Collection values() { + return values(DataCollectionMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java new file mode 100644 index 0000000000000..1008978a4c5ac --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The DataCollector model. */ +@Fluent +public final class DataCollector { + /* + * [Required] The collection configuration. Each collection has it own configuration to collect model data and the + * name of collection can be arbitrary string. + * Model data collector can be used for either payload logging or custom logging or both of them. Collection + * request and response are reserved for payload logging, others are for custom logging. + */ + @JsonProperty(value = "collections", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map collections; + + /* + * The request logging configuration for mdc, it includes advanced logging settings for all collections. It's + * optional. + */ + @JsonProperty(value = "requestLogging") + private RequestLogging requestLogging; + + /* + * When model data is collected to blob storage, we need to roll the data to different path to avoid logging all of + * them in a single blob file. + * If the rolling rate is hour, all data will be collected in the blob path /yyyy/MM/dd/HH/. + * If it's day, all data will be collected in blob path /yyyy/MM/dd/. + * The other benefit of rolling path is that model monitoring ui is able to select a time range of data very + * quickly. + */ + @JsonProperty(value = "rollingRate") + private RollingRateType rollingRate; + + /** Creates an instance of DataCollector class. */ + public DataCollector() { + } + + /** + * Get the collections property: [Required] The collection configuration. Each collection has it own configuration + * to collect model data and the name of collection can be arbitrary string. Model data collector can be used for + * either payload logging or custom logging or both of them. Collection request and response are reserved for + * payload logging, others are for custom logging. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: [Required] The collection configuration. Each collection has it own configuration + * to collect model data and the name of collection can be arbitrary string. Model data collector can be used for + * either payload logging or custom logging or both of them. Collection request and response are reserved for + * payload logging, others are for custom logging. + * + * @param collections the collections value to set. + * @return the DataCollector object itself. + */ + public DataCollector withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** + * Get the requestLogging property: The request logging configuration for mdc, it includes advanced logging settings + * for all collections. It's optional. + * + * @return the requestLogging value. + */ + public RequestLogging requestLogging() { + return this.requestLogging; + } + + /** + * Set the requestLogging property: The request logging configuration for mdc, it includes advanced logging settings + * for all collections. It's optional. + * + * @param requestLogging the requestLogging value to set. + * @return the DataCollector object itself. + */ + public DataCollector withRequestLogging(RequestLogging requestLogging) { + this.requestLogging = requestLogging; + return this; + } + + /** + * Get the rollingRate property: When model data is collected to blob storage, we need to roll the data to different + * path to avoid logging all of them in a single blob file. If the rolling rate is hour, all data will be collected + * in the blob path /yyyy/MM/dd/HH/. If it's day, all data will be collected in blob path /yyyy/MM/dd/. The other + * benefit of rolling path is that model monitoring ui is able to select a time range of data very quickly. + * + * @return the rollingRate value. + */ + public RollingRateType rollingRate() { + return this.rollingRate; + } + + /** + * Set the rollingRate property: When model data is collected to blob storage, we need to roll the data to different + * path to avoid logging all of them in a single blob file. If the rolling rate is hour, all data will be collected + * in the blob path /yyyy/MM/dd/HH/. If it's day, all data will be collected in blob path /yyyy/MM/dd/. The other + * benefit of rolling path is that model monitoring ui is able to select a time range of data very quickly. + * + * @param rollingRate the rollingRate value to set. + * @return the DataCollector object itself. + */ + public DataCollector withRollingRate(RollingRateType rollingRate) { + this.rollingRate = rollingRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (collections() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property collections in model DataCollector")); + } else { + collections() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (requestLogging() != null) { + requestLogging().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollector.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java index 59ae115c87e89..674fabc5121f1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java @@ -66,22 +66,25 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The DataContainer definition stages. */ interface DefinitionStages { /** The first stage of the DataContainer definition. */ interface Blank extends WithParentResource { } + /** The stage of the DataContainer definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. + * Specifies resourceGroupName, registryName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } + /** The stage of the DataContainer definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(DataContainerProperties properties); } + /** * The stage of the DataContainer definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { DataContainer create(Context context); } } + /** * Begins update for the DataContainer resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ DataContainer apply(Context context); } + /** The DataContainer update stages. */ interface UpdateStages { /** The stage of the DataContainer update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(DataContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java index 8962c038ec253..7449789db102e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; /** Resource collection API of DataContainers. */ public interface DataContainers { @@ -93,55 +94,32 @@ Response getWithResponse( DataContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - DataContainer getById(String id); - - /** - * Get container. + * Create or update container. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, DataContainerInner body, Context context); /** - * Delete container. + * Create or update container. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DataContainer resource. - * - * @param name resource name. - * @return the first stage of the new DataContainer definition. + * @return azure Resource Manager resource envelope. */ - DataContainer.DefinitionStages.Blank define(String name); + DataContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, DataContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java new file mode 100644 index 0000000000000..484faf51b39d8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The DataDriftMetricThresholdBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "dataType", + defaultImpl = DataDriftMetricThresholdBase.class) +@JsonTypeName("DataDriftMetricThresholdBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Categorical", value = CategoricalDataDriftMetricThreshold.class), + @JsonSubTypes.Type(name = "Numerical", value = NumericalDataDriftMetricThreshold.class) +}) +@Fluent +public class DataDriftMetricThresholdBase { + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of DataDriftMetricThresholdBase class. */ + public DataDriftMetricThresholdBase() { + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the DataDriftMetricThresholdBase object itself. + */ + public DataDriftMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java new file mode 100644 index 0000000000000..27d5be32120b3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The DataDriftMonitoringSignal model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("DataDrift") +@Fluent +public final class DataDriftMonitoringSignal extends MonitoringSignalBase { + /* + * The data segment used for scoping on a subset of the data population. + */ + @JsonProperty(value = "dataSegment") + private MonitoringDataSegment dataSegment; + + /* + * A dictionary that maps feature names to their respective data types. + */ + @JsonProperty(value = "featureDataTypeOverride") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map featureDataTypeOverride; + + /* + * The feature filter which identifies which feature to calculate drift over. + */ + @JsonProperty(value = "features") + private MonitoringFeatureFilterBase features; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * [Required] The data which drift will be calculated for. + */ + @JsonProperty(value = "productionData", required = true) + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + @JsonProperty(value = "referenceData", required = true) + private MonitoringInputDataBase referenceData; + + /** Creates an instance of DataDriftMonitoringSignal class. */ + public DataDriftMonitoringSignal() { + } + + /** + * Get the dataSegment property: The data segment used for scoping on a subset of the data population. + * + * @return the dataSegment value. + */ + public MonitoringDataSegment dataSegment() { + return this.dataSegment; + } + + /** + * Set the dataSegment property: The data segment used for scoping on a subset of the data population. + * + * @param dataSegment the dataSegment value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withDataSegment(MonitoringDataSegment dataSegment) { + this.dataSegment = dataSegment; + return this; + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withFeatureDataTypeOverride( + Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the features property: The feature filter which identifies which feature to calculate drift over. + * + * @return the features value. + */ + public MonitoringFeatureFilterBase features() { + return this.features; + } + + /** + * Set the features property: The feature filter which identifies which feature to calculate drift over. + * + * @param features the features value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withFeatures(MonitoringFeatureFilterBase features) { + this.features = features; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataDriftMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSegment() != null) { + dataSegment().validate(); + } + if (features() != null) { + features().validate(); + } + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model DataDriftMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productionData in model DataDriftMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property referenceData in model DataDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataDriftMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImport.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImport.java new file mode 100644 index 0000000000000..a3ee134e8be29 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImport.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** The DataImport model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("uri_folder") +@Fluent +public final class DataImport extends DataVersionBaseProperties { + /* + * Name of the asset for data import job to create + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Source data of the asset to import from + */ + @JsonProperty(value = "source") + private DataImportSource source; + + /** Creates an instance of DataImport class. */ + public DataImport() { + } + + /** + * Get the assetName property: Name of the asset for data import job to create. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Name of the asset for data import job to create. + * + * @param assetName the assetName value to set. + * @return the DataImport object itself. + */ + public DataImport withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the source property: Source data of the asset to import from. + * + * @return the source value. + */ + public DataImportSource source() { + return this.source; + } + + /** + * Set the source property: Source data of the asset to import from. + * + * @param source the source value to set. + * @return the DataImport object itself. + */ + public DataImport withSource(DataImportSource source) { + this.source = source; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withDataUri(String dataUri) { + super.withDataUri(dataUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withStage(String stage) { + super.withStage(stage); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withIsAnonymous(Boolean isAnonymous) { + super.withIsAnonymous(isAnonymous); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataImport withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (source() != null) { + source().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSource.java new file mode 100644 index 0000000000000..8ba6742edcc62 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSource.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The DataImportSource model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "sourceType", + defaultImpl = DataImportSource.class) +@JsonTypeName("DataImportSource") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "database", value = DatabaseSource.class), + @JsonSubTypes.Type(name = "file_system", value = FileSystemSource.class) +}) +@Fluent +public class DataImportSource { + /* + * Workspace connection for data import source storage + */ + @JsonProperty(value = "connection") + private String connection; + + /** Creates an instance of DataImportSource class. */ + public DataImportSource() { + } + + /** + * Get the connection property: Workspace connection for data import source storage. + * + * @return the connection value. + */ + public String connection() { + return this.connection; + } + + /** + * Set the connection property: Workspace connection for data import source storage. + * + * @param connection the connection value to set. + * @return the DataImportSource object itself. + */ + public DataImportSource withConnection(String connection) { + this.connection = connection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSourceType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSourceType.java new file mode 100644 index 0000000000000..bab6561721f71 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataImportSourceType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the type of data. */ +public final class DataImportSourceType extends ExpandableStringEnum { + /** Static value database for DataImportSourceType. */ + public static final DataImportSourceType DATABASE = fromString("database"); + + /** Static value file_system for DataImportSourceType. */ + public static final DataImportSourceType FILE_SYSTEM = fromString("file_system"); + + /** + * Creates a new instance of DataImportSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataImportSourceType() { + } + + /** + * Creates or finds a DataImportSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataImportSourceType. + */ + @JsonCreator + public static DataImportSourceType fromString(String name) { + return fromString(name, DataImportSourceType.class); + } + + /** + * Gets known DataImportSourceType values. + * + * @return known DataImportSourceType values. + */ + public static Collection values() { + return values(DataImportSourceType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java new file mode 100644 index 0000000000000..6ff863c121f69 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The DataQualityMetricThresholdBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "dataType", + defaultImpl = DataQualityMetricThresholdBase.class) +@JsonTypeName("DataQualityMetricThresholdBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Categorical", value = CategoricalDataQualityMetricThreshold.class), + @JsonSubTypes.Type(name = "Numerical", value = NumericalDataQualityMetricThreshold.class) +}) +@Fluent +public class DataQualityMetricThresholdBase { + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of DataQualityMetricThresholdBase class. */ + public DataQualityMetricThresholdBase() { + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the DataQualityMetricThresholdBase object itself. + */ + public DataQualityMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java new file mode 100644 index 0000000000000..972fda60f77e2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The DataQualityMonitoringSignal model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("DataQuality") +@Fluent +public final class DataQualityMonitoringSignal extends MonitoringSignalBase { + /* + * A dictionary that maps feature names to their respective data types. + */ + @JsonProperty(value = "featureDataTypeOverride") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map featureDataTypeOverride; + + /* + * The features to calculate drift over. + */ + @JsonProperty(value = "features") + private MonitoringFeatureFilterBase features; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * [Required] The data produced by the production service which drift will be calculated for. + */ + @JsonProperty(value = "productionData", required = true) + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + @JsonProperty(value = "referenceData", required = true) + private MonitoringInputDataBase referenceData; + + /** Creates an instance of DataQualityMonitoringSignal class. */ + public DataQualityMonitoringSignal() { + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withFeatureDataTypeOverride( + Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the features property: The features to calculate drift over. + * + * @return the features value. + */ + public MonitoringFeatureFilterBase features() { + return this.features; + } + + /** + * Set the features property: The features to calculate drift over. + * + * @param features the features value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withFeatures(MonitoringFeatureFilterBase features) { + this.features = features; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @param productionData the productionData value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataQualityMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataQualityMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (features() != null) { + features().validate(); + } + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model DataQualityMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productionData in model DataQualityMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property referenceData in model DataQualityMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataQualityMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java index ad254ac4664f8..26d7b28b296ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; @@ -66,23 +67,26 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The DataVersionBase definition stages. */ interface DefinitionStages { /** The first stage of the DataVersionBase definition. */ interface Blank extends WithParentResource { } + /** The stage of the DataVersionBase definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. + * Specifies resourceGroupName, registryName, name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @param name Container name. * @return the next definition stage. */ - WithProperties withExistingData(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingData(String resourceGroupName, String registryName, String name); } + /** The stage of the DataVersionBase definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +97,7 @@ interface WithProperties { */ WithCreate withProperties(DataVersionBaseProperties properties); } + /** * The stage of the DataVersionBase definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -114,6 +119,7 @@ interface WithCreate { DataVersionBase create(Context context); } } + /** * Begins update for the DataVersionBase resource. * @@ -138,6 +144,7 @@ interface Update extends UpdateStages.WithProperties { */ DataVersionBase apply(Context context); } + /** The DataVersionBase update stages. */ interface UpdateStages { /** The stage of the DataVersionBase update allowing to specify properties. */ @@ -151,6 +158,7 @@ interface WithProperties { Update withProperties(DataVersionBaseProperties properties); } } + /** * Refreshes the resource to sync with Azure. * @@ -165,4 +173,28 @@ interface WithProperties { * @return the refreshed resource. */ DataVersionBase refresh(Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java index ad6fb4df7677d..fbffc430fd7fd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java @@ -20,6 +20,7 @@ defaultImpl = DataVersionBaseProperties.class) @JsonTypeName("DataVersionBaseProperties") @JsonSubTypes({ + @JsonSubTypes.Type(name = "uri_folder", value = DataImport.class), @JsonSubTypes.Type(name = "mltable", value = MLTableData.class), @JsonSubTypes.Type(name = "uri_file", value = UriFileDataVersion.class), @JsonSubTypes.Type(name = "uri_folder", value = UriFolderDataVersion.class) @@ -27,19 +28,29 @@ @Fluent public class DataVersionBaseProperties extends AssetBase { /* - * [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + * [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ @JsonProperty(value = "dataUri", required = true) private String dataUri; + /* + * Intellectual Property details. Used if data is an Intellectual Property. + */ + @JsonProperty(value = "intellectualProperty") + private IntellectualProperty intellectualProperty; + + /* + * Stage in the data lifecycle assigned to this data asset + */ + @JsonProperty(value = "stage") + private String stage; + /** Creates an instance of DataVersionBaseProperties class. */ public DataVersionBaseProperties() { } /** - * Get the dataUri property: [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. + * Get the dataUri property: [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. * * @return the dataUri value. */ @@ -48,8 +59,7 @@ public String dataUri() { } /** - * Set the dataUri property: [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. + * Set the dataUri property: [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. * * @param dataUri the dataUri value to set. * @return the DataVersionBaseProperties object itself. @@ -59,6 +69,53 @@ public DataVersionBaseProperties withDataUri(String dataUri) { return this; } + /** + * Get the intellectualProperty property: Intellectual Property details. Used if data is an Intellectual Property. + * + * @return the intellectualProperty value. + */ + public IntellectualProperty intellectualProperty() { + return this.intellectualProperty; + } + + /** + * Set the intellectualProperty property: Intellectual Property details. Used if data is an Intellectual Property. + * + * @param intellectualProperty the intellectualProperty value to set. + * @return the DataVersionBaseProperties object itself. + */ + public DataVersionBaseProperties withIntellectualProperty(IntellectualProperty intellectualProperty) { + this.intellectualProperty = intellectualProperty; + return this; + } + + /** + * Get the stage property: Stage in the data lifecycle assigned to this data asset. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the data lifecycle assigned to this data asset. + * + * @param stage the stage value to set. + * @return the DataVersionBaseProperties object itself. + */ + public DataVersionBaseProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataVersionBaseProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public DataVersionBaseProperties withIsAnonymous(Boolean isAnonymous) { @@ -108,6 +165,9 @@ public void validate() { new IllegalArgumentException( "Missing required property dataUri in model DataVersionBaseProperties")); } + if (intellectualProperty() != null) { + intellectualProperty().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(DataVersionBaseProperties.class); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java index e5234415cf8bc..c8f1210d40894 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; /** Resource collection API of DataVersions. */ public interface DataVersions { @@ -36,6 +37,7 @@ public interface DataVersions { * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for * including/excluding (for example) archived entities. + * @param stage data stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -51,6 +53,7 @@ PagedIterable list( String skip, String tags, ListViewType listViewType, + String stage, Context context); /** @@ -113,55 +116,40 @@ Response getWithResponse( DataVersionBase get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - DataVersionBase getById(String id); - - /** - * Get version. + * Create or update version. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete version. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + DataVersionBaseInner body, + Context context); /** - * Delete version. + * Create or update version. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DataVersionBase resource. - * - * @param name resource name. - * @return the first stage of the new DataVersionBase definition. + * @return azure Resource Manager resource envelope. */ - DataVersionBase.DefinitionStages.Blank define(String name); + DataVersionBase createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabaseSource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabaseSource.java new file mode 100644 index 0000000000000..14ec895519965 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabaseSource.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The DatabaseSource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "sourceType") +@JsonTypeName("database") +@Fluent +public final class DatabaseSource extends DataImportSource { + /* + * SQL Query statement for data import Database source + */ + @JsonProperty(value = "query") + private String query; + + /* + * SQL StoredProcedure on data import Database source + */ + @JsonProperty(value = "storedProcedure") + private String storedProcedure; + + /* + * SQL StoredProcedure parameters + */ + @JsonProperty(value = "storedProcedureParams") + private List> storedProcedureParams; + + /* + * Name of the table on data import Database source + */ + @JsonProperty(value = "tableName") + private String tableName; + + /** Creates an instance of DatabaseSource class. */ + public DatabaseSource() { + } + + /** + * Get the query property: SQL Query statement for data import Database source. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: SQL Query statement for data import Database source. + * + * @param query the query value to set. + * @return the DatabaseSource object itself. + */ + public DatabaseSource withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the storedProcedure property: SQL StoredProcedure on data import Database source. + * + * @return the storedProcedure value. + */ + public String storedProcedure() { + return this.storedProcedure; + } + + /** + * Set the storedProcedure property: SQL StoredProcedure on data import Database source. + * + * @param storedProcedure the storedProcedure value to set. + * @return the DatabaseSource object itself. + */ + public DatabaseSource withStoredProcedure(String storedProcedure) { + this.storedProcedure = storedProcedure; + return this; + } + + /** + * Get the storedProcedureParams property: SQL StoredProcedure parameters. + * + * @return the storedProcedureParams value. + */ + public List> storedProcedureParams() { + return this.storedProcedureParams; + } + + /** + * Set the storedProcedureParams property: SQL StoredProcedure parameters. + * + * @param storedProcedureParams the storedProcedureParams value to set. + * @return the DatabaseSource object itself. + */ + public DatabaseSource withStoredProcedureParams(List> storedProcedureParams) { + this.storedProcedureParams = storedProcedureParams; + return this; + } + + /** + * Get the tableName property: Name of the table on data import Database source. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: Name of the table on data import Database source. + * + * @param tableName the tableName value to set. + * @return the DatabaseSource object itself. + */ + public DatabaseSource withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseSource withConnection(String connection) { + super.withConnection(connection); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatasetExportSummary.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatasetExportSummary.java new file mode 100644 index 0000000000000..30cf13948f52c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatasetExportSummary.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The DatasetExportSummary model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "format") +@JsonTypeName("Dataset") +@Immutable +public final class DatasetExportSummary extends ExportSummaryInner { + /* + * The unique name of the labeled data asset. + */ + @JsonProperty(value = "labeledAssetName", access = JsonProperty.Access.WRITE_ONLY) + private String labeledAssetName; + + /** Creates an instance of DatasetExportSummary class. */ + public DatasetExportSummary() { + } + + /** + * Get the labeledAssetName property: The unique name of the labeled data asset. + * + * @return the labeledAssetName value. + */ + public String labeledAssetName() { + return this.labeledAssetName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java index 7b181093c6e26..93cd4ec14f5a4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java @@ -67,11 +67,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The Datastore definition stages. */ interface DefinitionStages { /** The first stage of the Datastore definition. */ interface Blank extends WithParentResource { } + /** The stage of the Datastore definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -83,6 +85,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the Datastore definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +96,7 @@ interface WithProperties { */ WithCreate withProperties(DatastoreProperties properties); } + /** * The stage of the Datastore definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate extends DefinitionStages.WithSkipValidation { */ Datastore create(Context context); } + /** The stage of the Datastore definition allowing to specify skipValidation. */ interface WithSkipValidation { /** @@ -124,6 +129,7 @@ interface WithSkipValidation { WithCreate withSkipValidation(Boolean skipValidation); } } + /** * Begins update for the Datastore resource. * @@ -148,6 +154,7 @@ interface Update extends UpdateStages.WithProperties, UpdateStages.WithSkipValid */ Datastore apply(Context context); } + /** The Datastore update stages. */ interface UpdateStages { /** The stage of the Datastore update allowing to specify properties. */ @@ -160,6 +167,7 @@ interface WithProperties { */ Update withProperties(DatastoreProperties properties); } + /** The stage of the Datastore update allowing to specify skipValidation. */ interface WithSkipValidation { /** @@ -171,6 +179,7 @@ interface WithSkipValidation { Update withSkipValidation(Boolean skipValidation); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java index abb8e62f1cc3d..f96f516951e84 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java @@ -19,6 +19,8 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "AccountKey", value = AccountKeyDatastoreCredentials.class), @JsonSubTypes.Type(name = "Certificate", value = CertificateDatastoreCredentials.class), + @JsonSubTypes.Type(name = "KerberosKeytab", value = KerberosKeytabCredentials.class), + @JsonSubTypes.Type(name = "KerberosPassword", value = KerberosPasswordCredentials.class), @JsonSubTypes.Type(name = "None", value = NoneDatastoreCredentials.class), @JsonSubTypes.Type(name = "Sas", value = SasDatastoreCredentials.class), @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalDatastoreCredentials.class) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java index 053662bb3d116..b61d802098b14 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java @@ -23,7 +23,9 @@ @JsonSubTypes.Type(name = "AzureBlob", value = AzureBlobDatastore.class), @JsonSubTypes.Type(name = "AzureDataLakeGen1", value = AzureDataLakeGen1Datastore.class), @JsonSubTypes.Type(name = "AzureDataLakeGen2", value = AzureDataLakeGen2Datastore.class), - @JsonSubTypes.Type(name = "AzureFile", value = AzureFileDatastore.class) + @JsonSubTypes.Type(name = "AzureFile", value = AzureFileDatastore.class), + @JsonSubTypes.Type(name = "Hdfs", value = HdfsDatastore.class), + @JsonSubTypes.Type(name = "OneLake", value = OneLakeDatastore.class) }) @Fluent public class DatastoreProperties extends ResourceBase { @@ -33,6 +35,12 @@ public class DatastoreProperties extends ResourceBase { @JsonProperty(value = "credentials", required = true) private DatastoreCredentials credentials; + /* + * Intellectual Property details. + */ + @JsonProperty(value = "intellectualProperty") + private IntellectualProperty intellectualProperty; + /* * Readonly property to indicate if datastore is the workspace default datastore */ @@ -63,6 +71,26 @@ public DatastoreProperties withCredentials(DatastoreCredentials credentials) { return this; } + /** + * Get the intellectualProperty property: Intellectual Property details. + * + * @return the intellectualProperty value. + */ + public IntellectualProperty intellectualProperty() { + return this.intellectualProperty; + } + + /** + * Set the intellectualProperty property: Intellectual Property details. + * + * @param intellectualProperty the intellectualProperty value to set. + * @return the DatastoreProperties object itself. + */ + public DatastoreProperties withIntellectualProperty(IntellectualProperty intellectualProperty) { + this.intellectualProperty = intellectualProperty; + return this; + } + /** * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. * @@ -108,6 +136,9 @@ public void validate() { } else { credentials().validate(); } + if (intellectualProperty() != null) { + intellectualProperty().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(DatastoreProperties.class); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java index 0258a7e012f8c..3a92e8e0cab30 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java @@ -22,6 +22,12 @@ public final class DatastoreType extends ExpandableStringEnum { /** Static value AzureFile for DatastoreType. */ public static final DatastoreType AZURE_FILE = fromString("AzureFile"); + /** Static value Hdfs for DatastoreType. */ + public static final DatastoreType HDFS = fromString("Hdfs"); + + /** Static value OneLake for DatastoreType. */ + public static final DatastoreType ONE_LAKE = fromString("OneLake"); + /** * Creates a new instance of DatastoreType value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java index 652e1c26d99eb..063361d3c11e7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import java.util.List; import java.util.Map; /** The DeploymentResourceConfiguration model. */ @@ -28,6 +29,20 @@ public DeploymentResourceConfiguration withInstanceType(String instanceType) { return this; } + /** {@inheritDoc} */ + @Override + public DeploymentResourceConfiguration withLocations(List locations) { + super.withLocations(locations); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentResourceConfiguration withMaxInstanceCount(Integer maxInstanceCount) { + super.withMaxInstanceCount(maxInstanceCount); + return this; + } + /** {@inheritDoc} */ @Override public DeploymentResourceConfiguration withProperties(Map properties) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java index cb9851aa8b82c..d4f2ed014764d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java @@ -13,249 +13,249 @@ @Fluent public final class DiagnoseRequestProperties { /* - * Setting for diagnosing user defined routing + * Setting for diagnosing dependent application insights */ - @JsonProperty(value = "udr") + @JsonProperty(value = "applicationInsights") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map udr; + private Map applicationInsights; /* - * Setting for diagnosing network security group + * Setting for diagnosing dependent container registry */ - @JsonProperty(value = "nsg") + @JsonProperty(value = "containerRegistry") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map nsg; + private Map containerRegistry; /* - * Setting for diagnosing resource lock + * Setting for diagnosing dns resolution */ - @JsonProperty(value = "resourceLock") + @JsonProperty(value = "dnsResolution") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map resourceLock; + private Map dnsResolution; /* - * Setting for diagnosing dns resolution + * Setting for diagnosing dependent key vault */ - @JsonProperty(value = "dnsResolution") + @JsonProperty(value = "keyVault") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map dnsResolution; + private Map keyVault; /* - * Setting for diagnosing dependent storage account + * Setting for diagnosing network security group */ - @JsonProperty(value = "storageAccount") + @JsonProperty(value = "nsg") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map storageAccount; + private Map nsg; /* - * Setting for diagnosing dependent key vault + * Setting for diagnosing unclassified category of problems */ - @JsonProperty(value = "keyVault") + @JsonProperty(value = "others") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map keyVault; + private Map others; /* - * Setting for diagnosing dependent container registry + * Setting for diagnosing resource lock */ - @JsonProperty(value = "containerRegistry") + @JsonProperty(value = "resourceLock") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map containerRegistry; + private Map resourceLock; /* - * Setting for diagnosing dependent application insights + * Setting for diagnosing dependent storage account */ - @JsonProperty(value = "applicationInsights") + @JsonProperty(value = "storageAccount") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map applicationInsights; + private Map storageAccount; /* - * Setting for diagnosing unclassified category of problems + * Setting for diagnosing user defined routing */ - @JsonProperty(value = "others") + @JsonProperty(value = "udr") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map others; + private Map udr; /** Creates an instance of DiagnoseRequestProperties class. */ public DiagnoseRequestProperties() { } /** - * Get the udr property: Setting for diagnosing user defined routing. + * Get the applicationInsights property: Setting for diagnosing dependent application insights. * - * @return the udr value. + * @return the applicationInsights value. */ - public Map udr() { - return this.udr; + public Map applicationInsights() { + return this.applicationInsights; } /** - * Set the udr property: Setting for diagnosing user defined routing. + * Set the applicationInsights property: Setting for diagnosing dependent application insights. * - * @param udr the udr value to set. + * @param applicationInsights the applicationInsights value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withUdr(Map udr) { - this.udr = udr; + public DiagnoseRequestProperties withApplicationInsights(Map applicationInsights) { + this.applicationInsights = applicationInsights; return this; } /** - * Get the nsg property: Setting for diagnosing network security group. + * Get the containerRegistry property: Setting for diagnosing dependent container registry. * - * @return the nsg value. + * @return the containerRegistry value. */ - public Map nsg() { - return this.nsg; + public Map containerRegistry() { + return this.containerRegistry; } /** - * Set the nsg property: Setting for diagnosing network security group. + * Set the containerRegistry property: Setting for diagnosing dependent container registry. * - * @param nsg the nsg value to set. + * @param containerRegistry the containerRegistry value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withNsg(Map nsg) { - this.nsg = nsg; + public DiagnoseRequestProperties withContainerRegistry(Map containerRegistry) { + this.containerRegistry = containerRegistry; return this; } /** - * Get the resourceLock property: Setting for diagnosing resource lock. + * Get the dnsResolution property: Setting for diagnosing dns resolution. * - * @return the resourceLock value. + * @return the dnsResolution value. */ - public Map resourceLock() { - return this.resourceLock; + public Map dnsResolution() { + return this.dnsResolution; } /** - * Set the resourceLock property: Setting for diagnosing resource lock. + * Set the dnsResolution property: Setting for diagnosing dns resolution. * - * @param resourceLock the resourceLock value to set. + * @param dnsResolution the dnsResolution value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withResourceLock(Map resourceLock) { - this.resourceLock = resourceLock; + public DiagnoseRequestProperties withDnsResolution(Map dnsResolution) { + this.dnsResolution = dnsResolution; return this; } /** - * Get the dnsResolution property: Setting for diagnosing dns resolution. + * Get the keyVault property: Setting for diagnosing dependent key vault. * - * @return the dnsResolution value. + * @return the keyVault value. */ - public Map dnsResolution() { - return this.dnsResolution; + public Map keyVault() { + return this.keyVault; } /** - * Set the dnsResolution property: Setting for diagnosing dns resolution. + * Set the keyVault property: Setting for diagnosing dependent key vault. * - * @param dnsResolution the dnsResolution value to set. + * @param keyVault the keyVault value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withDnsResolution(Map dnsResolution) { - this.dnsResolution = dnsResolution; + public DiagnoseRequestProperties withKeyVault(Map keyVault) { + this.keyVault = keyVault; return this; } /** - * Get the storageAccount property: Setting for diagnosing dependent storage account. + * Get the nsg property: Setting for diagnosing network security group. * - * @return the storageAccount value. + * @return the nsg value. */ - public Map storageAccount() { - return this.storageAccount; + public Map nsg() { + return this.nsg; } /** - * Set the storageAccount property: Setting for diagnosing dependent storage account. + * Set the nsg property: Setting for diagnosing network security group. * - * @param storageAccount the storageAccount value to set. + * @param nsg the nsg value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withStorageAccount(Map storageAccount) { - this.storageAccount = storageAccount; + public DiagnoseRequestProperties withNsg(Map nsg) { + this.nsg = nsg; return this; } /** - * Get the keyVault property: Setting for diagnosing dependent key vault. + * Get the others property: Setting for diagnosing unclassified category of problems. * - * @return the keyVault value. + * @return the others value. */ - public Map keyVault() { - return this.keyVault; + public Map others() { + return this.others; } /** - * Set the keyVault property: Setting for diagnosing dependent key vault. + * Set the others property: Setting for diagnosing unclassified category of problems. * - * @param keyVault the keyVault value to set. + * @param others the others value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withKeyVault(Map keyVault) { - this.keyVault = keyVault; + public DiagnoseRequestProperties withOthers(Map others) { + this.others = others; return this; } /** - * Get the containerRegistry property: Setting for diagnosing dependent container registry. + * Get the resourceLock property: Setting for diagnosing resource lock. * - * @return the containerRegistry value. + * @return the resourceLock value. */ - public Map containerRegistry() { - return this.containerRegistry; + public Map resourceLock() { + return this.resourceLock; } /** - * Set the containerRegistry property: Setting for diagnosing dependent container registry. + * Set the resourceLock property: Setting for diagnosing resource lock. * - * @param containerRegistry the containerRegistry value to set. + * @param resourceLock the resourceLock value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withContainerRegistry(Map containerRegistry) { - this.containerRegistry = containerRegistry; + public DiagnoseRequestProperties withResourceLock(Map resourceLock) { + this.resourceLock = resourceLock; return this; } /** - * Get the applicationInsights property: Setting for diagnosing dependent application insights. + * Get the storageAccount property: Setting for diagnosing dependent storage account. * - * @return the applicationInsights value. + * @return the storageAccount value. */ - public Map applicationInsights() { - return this.applicationInsights; + public Map storageAccount() { + return this.storageAccount; } /** - * Set the applicationInsights property: Setting for diagnosing dependent application insights. + * Set the storageAccount property: Setting for diagnosing dependent storage account. * - * @param applicationInsights the applicationInsights value to set. + * @param storageAccount the storageAccount value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withApplicationInsights(Map applicationInsights) { - this.applicationInsights = applicationInsights; + public DiagnoseRequestProperties withStorageAccount(Map storageAccount) { + this.storageAccount = storageAccount; return this; } /** - * Get the others property: Setting for diagnosing unclassified category of problems. + * Get the udr property: Setting for diagnosing user defined routing. * - * @return the others value. + * @return the udr value. */ - public Map others() { - return this.others; + public Map udr() { + return this.udr; } /** - * Set the others property: Setting for diagnosing unclassified category of problems. + * Set the udr property: Setting for diagnosing user defined routing. * - * @param others the others value to set. + * @param udr the udr value to set. * @return the DiagnoseRequestProperties object itself. */ - public DiagnoseRequestProperties withOthers(Map others) { - this.others = others; + public DiagnoseRequestProperties withUdr(Map udr) { + this.udr = udr; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java index f0a37ececc467..11d4b6e30148b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java @@ -11,7 +11,7 @@ @Fluent public final class DiagnoseWorkspaceParameters { /* - * Value of Parameters + * The value property. */ @JsonProperty(value = "value") private DiagnoseRequestProperties value; @@ -21,7 +21,7 @@ public DiagnoseWorkspaceParameters() { } /** - * Get the value property: Value of Parameters. + * Get the value property: The value property. * * @return the value value. */ @@ -30,7 +30,7 @@ public DiagnoseRequestProperties value() { } /** - * Set the value property: Value of Parameters. + * Set the value property: The value property. * * @param value the value value to set. * @return the DiagnoseWorkspaceParameters object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java index 059ddfa4210a4..76c706a50ff63 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java @@ -19,6 +19,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "Mpi", value = Mpi.class), @JsonSubTypes.Type(name = "PyTorch", value = PyTorch.class), + @JsonSubTypes.Type(name = "Ray", value = Ray.class), @JsonSubTypes.Type(name = "TensorFlow", value = TensorFlow.class) }) @Immutable diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java index 79c7b8c646ad9..63700347b36b1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java @@ -19,6 +19,9 @@ public final class DistributionType extends ExpandableStringEnum + */ + @JsonIgnore private Map additionalProperties; + + /** Creates an instance of Docker class. */ + public Docker() { + } + + /** + * Get the privileged property: Indicate whether container shall run in privileged or non-privileged mode. + * + * @return the privileged value. + */ + public Boolean privileged() { + return this.privileged; + } + + /** + * Set the privileged property: Indicate whether container shall run in privileged or non-privileged mode. + * + * @param privileged the privileged value to set. + * @return the Docker object itself. + */ + public Docker withPrivileged(Boolean privileged) { + this.privileged = privileged; + return this; + } + + /** + * Get the additionalProperties property: Dictionary of <any>. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Dictionary of <any>. + * + * @param additionalProperties the additionalProperties value to set. + * @return the Docker object itself. + */ + public Docker withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailMonitoringAlertNotificationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailMonitoringAlertNotificationSettings.java new file mode 100644 index 0000000000000..2fa2a6b280384 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailMonitoringAlertNotificationSettings.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The EmailMonitoringAlertNotificationSettings model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertNotificationType") +@JsonTypeName("Email") +@Fluent +public final class EmailMonitoringAlertNotificationSettings extends MonitoringAlertNotificationSettingsBase { + /* + * Configuration for notification. + */ + @JsonProperty(value = "emailNotificationSetting") + private NotificationSetting emailNotificationSetting; + + /** Creates an instance of EmailMonitoringAlertNotificationSettings class. */ + public EmailMonitoringAlertNotificationSettings() { + } + + /** + * Get the emailNotificationSetting property: Configuration for notification. + * + * @return the emailNotificationSetting value. + */ + public NotificationSetting emailNotificationSetting() { + return this.emailNotificationSetting; + } + + /** + * Set the emailNotificationSetting property: Configuration for notification. + * + * @param emailNotificationSetting the emailNotificationSetting value to set. + * @return the EmailMonitoringAlertNotificationSettings object itself. + */ + public EmailMonitoringAlertNotificationSettings withEmailNotificationSetting( + NotificationSetting emailNotificationSetting) { + this.emailNotificationSetting = emailNotificationSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (emailNotificationSetting() != null) { + emailNotificationSetting().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java new file mode 100644 index 0000000000000..1afe39952eea2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the email notification type. */ +public final class EmailNotificationEnableType extends ExpandableStringEnum { + /** Static value JobCompleted for EmailNotificationEnableType. */ + public static final EmailNotificationEnableType JOB_COMPLETED = fromString("JobCompleted"); + + /** Static value JobFailed for EmailNotificationEnableType. */ + public static final EmailNotificationEnableType JOB_FAILED = fromString("JobFailed"); + + /** Static value JobCancelled for EmailNotificationEnableType. */ + public static final EmailNotificationEnableType JOB_CANCELLED = fromString("JobCancelled"); + + /** + * Creates a new instance of EmailNotificationEnableType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EmailNotificationEnableType() { + } + + /** + * Creates or finds a EmailNotificationEnableType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EmailNotificationEnableType. + */ + @JsonCreator + public static EmailNotificationEnableType fromString(String name) { + return fromString(name, EmailNotificationEnableType.class); + } + + /** + * Gets known EmailNotificationEnableType values. + * + * @return known EmailNotificationEnableType values. + */ + public static Collection values() { + return values(EmailNotificationEnableType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java deleted file mode 100644 index b5dece8ac6eee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The EncryptionKeyVaultProperties model. */ -@Fluent -public final class EncryptionKeyVaultProperties { - /* - * The ArmId of the keyVault where the customer owned encryption key is present. - */ - @JsonProperty(value = "keyVaultArmId", required = true) - private String keyVaultArmId; - - /* - * Key vault uri to access the encryption key. - */ - @JsonProperty(value = "keyIdentifier", required = true) - private String keyIdentifier; - - /* - * For future use - The client id of the identity which will be used to access key vault. - */ - @JsonProperty(value = "identityClientId") - private String identityClientId; - - /** Creates an instance of EncryptionKeyVaultProperties class. */ - public EncryptionKeyVaultProperties() { - } - - /** - * Get the keyVaultArmId property: The ArmId of the keyVault where the customer owned encryption key is present. - * - * @return the keyVaultArmId value. - */ - public String keyVaultArmId() { - return this.keyVaultArmId; - } - - /** - * Set the keyVaultArmId property: The ArmId of the keyVault where the customer owned encryption key is present. - * - * @param keyVaultArmId the keyVaultArmId value to set. - * @return the EncryptionKeyVaultProperties object itself. - */ - public EncryptionKeyVaultProperties withKeyVaultArmId(String keyVaultArmId) { - this.keyVaultArmId = keyVaultArmId; - return this; - } - - /** - * Get the keyIdentifier property: Key vault uri to access the encryption key. - * - * @return the keyIdentifier value. - */ - public String keyIdentifier() { - return this.keyIdentifier; - } - - /** - * Set the keyIdentifier property: Key vault uri to access the encryption key. - * - * @param keyIdentifier the keyIdentifier value to set. - * @return the EncryptionKeyVaultProperties object itself. - */ - public EncryptionKeyVaultProperties withKeyIdentifier(String keyIdentifier) { - this.keyIdentifier = keyIdentifier; - return this; - } - - /** - * Get the identityClientId property: For future use - The client id of the identity which will be used to access - * key vault. - * - * @return the identityClientId value. - */ - public String identityClientId() { - return this.identityClientId; - } - - /** - * Set the identityClientId property: For future use - The client id of the identity which will be used to access - * key vault. - * - * @param identityClientId the identityClientId value to set. - * @return the EncryptionKeyVaultProperties object itself. - */ - public EncryptionKeyVaultProperties withIdentityClientId(String identityClientId) { - this.identityClientId = identityClientId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultArmId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyVaultArmId in model EncryptionKeyVaultProperties")); - } - if (keyIdentifier() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyIdentifier in model EncryptionKeyVaultProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyVaultProperties.class); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java new file mode 100644 index 0000000000000..16ee181fce84a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EncryptionKeyVaultUpdateProperties model. */ +@Fluent +public final class EncryptionKeyVaultUpdateProperties { + /* + * The keyIdentifier property. + */ + @JsonProperty(value = "keyIdentifier", required = true) + private String keyIdentifier; + + /** Creates an instance of EncryptionKeyVaultUpdateProperties class. */ + public EncryptionKeyVaultUpdateProperties() { + } + + /** + * Get the keyIdentifier property: The keyIdentifier property. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The keyIdentifier property. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the EncryptionKeyVaultUpdateProperties object itself. + */ + public EncryptionKeyVaultUpdateProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyIdentifier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyIdentifier in model EncryptionKeyVaultUpdateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyVaultUpdateProperties.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java index a56f01ee36e6f..e95987a899967 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java @@ -12,49 +12,72 @@ @Fluent public final class EncryptionProperty { /* - * Indicates whether or not the encryption is enabled for the workspace. + * The byok cosmosdb account that customer brings to store customer's data + * with encryption */ - @JsonProperty(value = "status", required = true) - private EncryptionStatus status; + @JsonProperty(value = "cosmosDbResourceId") + private String cosmosDbResourceId; /* - * The identity that will be used to access the key vault for encryption at rest. + * Identity to be used with the keyVault */ @JsonProperty(value = "identity") private IdentityForCmk identity; /* - * Customer Key vault properties. + * KeyVault details to do the encryption */ @JsonProperty(value = "keyVaultProperties", required = true) - private EncryptionKeyVaultProperties keyVaultProperties; + private KeyVaultProperties keyVaultProperties; + + /* + * The byok search account that customer brings to store customer's data + * with encryption + */ + @JsonProperty(value = "searchAccountResourceId") + private String searchAccountResourceId; + + /* + * Indicates whether or not the encryption is enabled for the workspace. + */ + @JsonProperty(value = "status", required = true) + private EncryptionStatus status; + + /* + * The byok storage account that customer brings to store customer's data + * with encryption + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; /** Creates an instance of EncryptionProperty class. */ public EncryptionProperty() { } /** - * Get the status property: Indicates whether or not the encryption is enabled for the workspace. + * Get the cosmosDbResourceId property: The byok cosmosdb account that customer brings to store customer's data with + * encryption. * - * @return the status value. + * @return the cosmosDbResourceId value. */ - public EncryptionStatus status() { - return this.status; + public String cosmosDbResourceId() { + return this.cosmosDbResourceId; } /** - * Set the status property: Indicates whether or not the encryption is enabled for the workspace. + * Set the cosmosDbResourceId property: The byok cosmosdb account that customer brings to store customer's data with + * encryption. * - * @param status the status value to set. + * @param cosmosDbResourceId the cosmosDbResourceId value to set. * @return the EncryptionProperty object itself. */ - public EncryptionProperty withStatus(EncryptionStatus status) { - this.status = status; + public EncryptionProperty withCosmosDbResourceId(String cosmosDbResourceId) { + this.cosmosDbResourceId = cosmosDbResourceId; return this; } /** - * Get the identity property: The identity that will be used to access the key vault for encryption at rest. + * Get the identity property: Identity to be used with the keyVault. * * @return the identity value. */ @@ -63,7 +86,7 @@ public IdentityForCmk identity() { } /** - * Set the identity property: The identity that will be used to access the key vault for encryption at rest. + * Set the identity property: Identity to be used with the keyVault. * * @param identity the identity value to set. * @return the EncryptionProperty object itself. @@ -74,36 +97,95 @@ public EncryptionProperty withIdentity(IdentityForCmk identity) { } /** - * Get the keyVaultProperties property: Customer Key vault properties. + * Get the keyVaultProperties property: KeyVault details to do the encryption. * * @return the keyVaultProperties value. */ - public EncryptionKeyVaultProperties keyVaultProperties() { + public KeyVaultProperties keyVaultProperties() { return this.keyVaultProperties; } /** - * Set the keyVaultProperties property: Customer Key vault properties. + * Set the keyVaultProperties property: KeyVault details to do the encryption. * * @param keyVaultProperties the keyVaultProperties value to set. * @return the EncryptionProperty object itself. */ - public EncryptionProperty withKeyVaultProperties(EncryptionKeyVaultProperties keyVaultProperties) { + public EncryptionProperty withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { this.keyVaultProperties = keyVaultProperties; return this; } + /** + * Get the searchAccountResourceId property: The byok search account that customer brings to store customer's data + * with encryption. + * + * @return the searchAccountResourceId value. + */ + public String searchAccountResourceId() { + return this.searchAccountResourceId; + } + + /** + * Set the searchAccountResourceId property: The byok search account that customer brings to store customer's data + * with encryption. + * + * @param searchAccountResourceId the searchAccountResourceId value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withSearchAccountResourceId(String searchAccountResourceId) { + this.searchAccountResourceId = searchAccountResourceId; + return this; + } + + /** + * Get the status property: Indicates whether or not the encryption is enabled for the workspace. + * + * @return the status value. + */ + public EncryptionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether or not the encryption is enabled for the workspace. + * + * @param status the status value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withStatus(EncryptionStatus status) { + this.status = status; + return this; + } + + /** + * Get the storageAccountResourceId property: The byok storage account that customer brings to store customer's data + * with encryption. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: The byok storage account that customer brings to store customer's data + * with encryption. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property status in model EncryptionProperty")); - } if (identity() != null) { identity().validate(); } @@ -115,6 +197,11 @@ public void validate() { } else { keyVaultProperties().validate(); } + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model EncryptionProperty")); + } } private static final ClientLogger LOGGER = new ClientLogger(EncryptionProperty.class); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java new file mode 100644 index 0000000000000..9555e5a0c10ef --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EncryptionUpdateProperties model. */ +@Fluent +public final class EncryptionUpdateProperties { + /* + * The keyVaultProperties property. + */ + @JsonProperty(value = "keyVaultProperties", required = true) + private EncryptionKeyVaultUpdateProperties keyVaultProperties; + + /** Creates an instance of EncryptionUpdateProperties class. */ + public EncryptionUpdateProperties() { + } + + /** + * Get the keyVaultProperties property: The keyVaultProperties property. + * + * @return the keyVaultProperties value. + */ + public EncryptionKeyVaultUpdateProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The keyVaultProperties property. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionUpdateProperties object itself. + */ + public EncryptionUpdateProperties withKeyVaultProperties(EncryptionKeyVaultUpdateProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultProperties in model EncryptionUpdateProperties")); + } else { + keyVaultProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionUpdateProperties.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java new file mode 100644 index 0000000000000..8965468c67913 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Endpoint model. */ +@Fluent +public final class Endpoint { + /* + * Endpoint Communication Protocol + * + * Protocol over which communication will happen over this endpoint + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /* + * Name of the Endpoint + */ + @JsonProperty(value = "name") + private String name; + + /* + * Application port inside the container. + */ + @JsonProperty(value = "target") + private Integer target; + + /* + * Port over which the application is exposed from container. + */ + @JsonProperty(value = "published") + private Integer published; + + /* + * Host IP over which the application is exposed from the container + */ + @JsonProperty(value = "hostIp") + private String hostIp; + + /** Creates an instance of Endpoint class. */ + public Endpoint() { + } + + /** + * Get the protocol property: Endpoint Communication Protocol + * + *

Protocol over which communication will happen over this endpoint. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Endpoint Communication Protocol + * + *

Protocol over which communication will happen over this endpoint. + * + * @param protocol the protocol value to set. + * @return the Endpoint object itself. + */ + public Endpoint withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the name property: Name of the Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Endpoint. + * + * @param name the name value to set. + * @return the Endpoint object itself. + */ + public Endpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the target property: Application port inside the container. + * + * @return the target value. + */ + public Integer target() { + return this.target; + } + + /** + * Set the target property: Application port inside the container. + * + * @param target the target value to set. + * @return the Endpoint object itself. + */ + public Endpoint withTarget(Integer target) { + this.target = target; + return this; + } + + /** + * Get the published property: Port over which the application is exposed from container. + * + * @return the published value. + */ + public Integer published() { + return this.published; + } + + /** + * Set the published property: Port over which the application is exposed from container. + * + * @param published the published value to set. + * @return the Endpoint object itself. + */ + public Endpoint withPublished(Integer published) { + this.published = published; + return this; + } + + /** + * Get the hostIp property: Host IP over which the application is exposed from the container. + * + * @return the hostIp value. + */ + public String hostIp() { + return this.hostIp; + } + + /** + * Set the hostIp property: Host IP over which the application is exposed from the container. + * + * @param hostIp the hostIp value to set. + * @return the Endpoint object itself. + */ + public Endpoint withHostIp(String hostIp) { + this.hostIp = hostIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java index 9f210ec5de03b..77c525258f2df 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java @@ -25,7 +25,7 @@ public class EndpointDeploymentPropertiesBase { private String description; /* - * ARM resource ID or AssetId of the environment specification for the endpoint deployment. + * ARM resource ID of the environment specification for the endpoint deployment. */ @JsonProperty(value = "environmentId") private String environmentId; @@ -89,8 +89,7 @@ public EndpointDeploymentPropertiesBase withDescription(String description) { } /** - * Get the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint - * deployment. + * Get the environmentId property: ARM resource ID of the environment specification for the endpoint deployment. * * @return the environmentId value. */ @@ -99,8 +98,7 @@ public String environmentId() { } /** - * Set the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint - * deployment. + * Set the environmentId property: ARM resource ID of the environment specification for the endpoint deployment. * * @param environmentId the environmentId value to set. * @return the EndpointDeploymentPropertiesBase object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..209037c638cbb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Connection status of the service consumer with the service provider. */ +public final class EndpointServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Approved for EndpointServiceConnectionStatus. */ + public static final EndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Pending for EndpointServiceConnectionStatus. */ + public static final EndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Rejected for EndpointServiceConnectionStatus. */ + public static final EndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for EndpointServiceConnectionStatus. */ + public static final EndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Timeout for EndpointServiceConnectionStatus. */ + public static final EndpointServiceConnectionStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates a new instance of EndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a EndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointServiceConnectionStatus. + */ + @JsonCreator + public static EndpointServiceConnectionStatus fromString(String name) { + return fromString(name, EndpointServiceConnectionStatus.class); + } + + /** + * Gets known EndpointServiceConnectionStatus values. + * + * @return known EndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(EndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java index 0256e791b224a..2090a05417d44 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java @@ -66,22 +66,25 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The EnvironmentContainer definition stages. */ interface DefinitionStages { /** The first stage of the EnvironmentContainer definition. */ interface Blank extends WithParentResource { } + /** The stage of the EnvironmentContainer definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. + * Specifies resourceGroupName, registryName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } + /** The stage of the EnvironmentContainer definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(EnvironmentContainerProperties properties); } + /** * The stage of the EnvironmentContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { EnvironmentContainer create(Context context); } } + /** * Begins update for the EnvironmentContainer resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ EnvironmentContainer apply(Context context); } + /** The EnvironmentContainer update stages. */ interface UpdateStages { /** The stage of the EnvironmentContainer update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(EnvironmentContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java index 772621f9cc4fd..8457c845624e2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java @@ -5,15 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Container for environment specification versions. */ @Fluent public final class EnvironmentContainerProperties extends AssetContainer { + /* + * Provisioning state for the environment container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of EnvironmentContainerProperties class. */ public EnvironmentContainerProperties() { } + /** + * Get the provisioningState property: Provisioning state for the environment container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + /** {@inheritDoc} */ @Override public EnvironmentContainerProperties withIsArchived(Boolean isArchived) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java index a78c04678f4d4..2981052ad42df 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; /** Resource collection API of EnvironmentContainers. */ public interface EnvironmentContainers { @@ -93,55 +94,33 @@ Response getWithResponse( EnvironmentContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - EnvironmentContainer getById(String id); - - /** - * Get container. + * Create or update container. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body, Context context); /** - * Delete container. + * Create or update container. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new EnvironmentContainer resource. - * - * @param name resource name. - * @return the first stage of the new EnvironmentContainer definition. + * @return azure Resource Manager resource envelope. */ - EnvironmentContainer.DefinitionStages.Blank define(String name); + EnvironmentContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java new file mode 100644 index 0000000000000..4e44d10cecb8d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** The EnvironmentVariable model. */ +@Fluent +public final class EnvironmentVariable { + /* + * Type of Environment Variable + * + * Type of the Environment Variable. Possible values are: local - For local variable + */ + @JsonProperty(value = "type") + private EnvironmentVariableType type; + + /* + * Value of the Environment variable + */ + @JsonProperty(value = "value") + private String value; + + /* + * Dictionary of + */ + @JsonIgnore private Map additionalProperties; + + /** Creates an instance of EnvironmentVariable class. */ + public EnvironmentVariable() { + } + + /** + * Get the type property: Type of Environment Variable + * + *

Type of the Environment Variable. Possible values are: local - For local variable. + * + * @return the type value. + */ + public EnvironmentVariableType type() { + return this.type; + } + + /** + * Set the type property: Type of Environment Variable + * + *

Type of the Environment Variable. Possible values are: local - For local variable. + * + * @param type the type value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withType(EnvironmentVariableType type) { + this.type = type; + return this; + } + + /** + * Get the value property: Value of the Environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the Environment variable. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the additionalProperties property: Dictionary of <any>. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Dictionary of <any>. + * + * @param additionalProperties the additionalProperties value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java new file mode 100644 index 0000000000000..aa656a8a69863 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of Environment Variable + * + *

Type of the Environment Variable. Possible values are: local - For local variable. + */ +public final class EnvironmentVariableType extends ExpandableStringEnum { + /** Static value local for EnvironmentVariableType. */ + public static final EnvironmentVariableType LOCAL = fromString("local"); + + /** + * Creates a new instance of EnvironmentVariableType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentVariableType() { + } + + /** + * Creates or finds a EnvironmentVariableType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentVariableType. + */ + @JsonCreator + public static EnvironmentVariableType fromString(String name) { + return fromString(name, EnvironmentVariableType.class); + } + + /** + * Gets known EnvironmentVariableType values. + * + * @return known EnvironmentVariableType values. + */ + public static Collection values() { + return values(EnvironmentVariableType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java index 8c72da86c8b0e..efd8ffc02dac8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java @@ -66,23 +66,27 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The EnvironmentVersion definition stages. */ interface DefinitionStages { /** The first stage of the EnvironmentVersion definition. */ interface Blank extends WithParentResource { } + /** The stage of the EnvironmentVersion definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. + * Specifies resourceGroupName, registryName, environmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. * @return the next definition stage. */ - WithProperties withExistingEnvironment(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingEnvironment( + String resourceGroupName, String registryName, String environmentName); } + /** The stage of the EnvironmentVersion definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +97,7 @@ interface WithProperties { */ WithCreate withProperties(EnvironmentVersionProperties properties); } + /** * The stage of the EnvironmentVersion definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -114,6 +119,7 @@ interface WithCreate { EnvironmentVersion create(Context context); } } + /** * Begins update for the EnvironmentVersion resource. * @@ -138,6 +144,7 @@ interface Update extends UpdateStages.WithProperties { */ EnvironmentVersion apply(Context context); } + /** The EnvironmentVersion update stages. */ interface UpdateStages { /** The stage of the EnvironmentVersion update allowing to specify properties. */ @@ -151,6 +158,7 @@ interface WithProperties { Update withProperties(EnvironmentVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java index 97f7ff9208937..d98fd17974cfe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java @@ -43,8 +43,7 @@ public final class EnvironmentVersionProperties extends AssetBase { /* * Name of the image that will be used for the environment. * */ @JsonProperty(value = "image") @@ -56,12 +55,30 @@ public final class EnvironmentVersionProperties extends AssetBase { @JsonProperty(value = "inferenceConfig") private InferenceContainerProperties inferenceConfig; + /* + * Intellectual Property details. Used if environment is an Intellectual Property. + */ + @JsonProperty(value = "intellectualProperty") + private IntellectualProperty intellectualProperty; + /* * The OS type of the environment. */ @JsonProperty(value = "osType") private OperatingSystemType osType; + /* + * Provisioning state for the environment version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /* + * Stage in the environment lifecycle assigned to this environment + */ + @JsonProperty(value = "stage") + private String stage; + /** Creates an instance of EnvironmentVersionProperties class. */ public EnvironmentVersionProperties() { } @@ -144,8 +161,7 @@ public EnvironmentType environmentType() { /** * Get the image property: Name of the image that will be used for the environment. <seealso - * href="https://docs.microsoft.com/en-us/azure/machine-learning" - + "/how-to-deploy-custom-docker-image#use-a-custom-base-image" + * href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" * />. * * @return the image value. @@ -156,8 +172,7 @@ public String image() { /** * Set the image property: Name of the image that will be used for the environment. <seealso - * href="https://docs.microsoft.com/en-us/azure/machine-learning" - + "/how-to-deploy-custom-docker-image#use-a-custom-base-image" + * href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" * />. * * @param image the image value to set. @@ -188,6 +203,28 @@ public EnvironmentVersionProperties withInferenceConfig(InferenceContainerProper return this; } + /** + * Get the intellectualProperty property: Intellectual Property details. Used if environment is an Intellectual + * Property. + * + * @return the intellectualProperty value. + */ + public IntellectualProperty intellectualProperty() { + return this.intellectualProperty; + } + + /** + * Set the intellectualProperty property: Intellectual Property details. Used if environment is an Intellectual + * Property. + * + * @param intellectualProperty the intellectualProperty value to set. + * @return the EnvironmentVersionProperties object itself. + */ + public EnvironmentVersionProperties withIntellectualProperty(IntellectualProperty intellectualProperty) { + this.intellectualProperty = intellectualProperty; + return this; + } + /** * Get the osType property: The OS type of the environment. * @@ -208,6 +245,42 @@ public EnvironmentVersionProperties withOsType(OperatingSystemType osType) { return this; } + /** + * Get the provisioningState property: Provisioning state for the environment version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Stage in the environment lifecycle assigned to this environment. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the environment lifecycle assigned to this environment. + * + * @param stage the stage value to set. + * @return the EnvironmentVersionProperties object itself. + */ + public EnvironmentVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public EnvironmentVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public EnvironmentVersionProperties withIsAnonymous(Boolean isAnonymous) { @@ -257,5 +330,8 @@ public void validate() { if (inferenceConfig() != null) { inferenceConfig().validate(); } + if (intellectualProperty() != null) { + intellectualProperty().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java index 42d2c70958795..4ab6eca5e2124 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; /** Resource collection API of EnvironmentVersions. */ public interface EnvironmentVersions { @@ -33,6 +34,7 @@ public interface EnvironmentVersions { * @param top Maximum number of records to return. * @param skip Continuation token for pagination. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -47,6 +49,7 @@ PagedIterable list( Integer top, String skip, ListViewType listViewType, + String stage, Context context); /** @@ -109,55 +112,40 @@ Response getWithResponse( EnvironmentVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. + * Creates or updates an EnvironmentVersion. * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - EnvironmentVersion getById(String id); - - /** - * Get version. - * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param version Version of EnvironmentVersion. + * @param body Definition of EnvironmentVersion. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete version. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + EnvironmentVersionInner body, + Context context); /** - * Delete version. + * Creates or updates an EnvironmentVersion. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param version Version of EnvironmentVersion. + * @param body Definition of EnvironmentVersion. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new EnvironmentVersion resource. - * - * @param name resource name. - * @return the first stage of the new EnvironmentVersion definition. + * @return azure Resource Manager resource envelope. */ - EnvironmentVersion.DefinitionStages.Blank define(String name); + EnvironmentVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportFormatType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportFormatType.java new file mode 100644 index 0000000000000..68ceee2c978f6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportFormatType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The format of exported labels. */ +public final class ExportFormatType extends ExpandableStringEnum { + /** Static value Dataset for ExportFormatType. */ + public static final ExportFormatType DATASET = fromString("Dataset"); + + /** Static value Coco for ExportFormatType. */ + public static final ExportFormatType COCO = fromString("Coco"); + + /** Static value CSV for ExportFormatType. */ + public static final ExportFormatType CSV = fromString("CSV"); + + /** + * Creates a new instance of ExportFormatType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExportFormatType() { + } + + /** + * Creates or finds a ExportFormatType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportFormatType. + */ + @JsonCreator + public static ExportFormatType fromString(String name) { + return fromString(name, ExportFormatType.class); + } + + /** + * Gets known ExportFormatType values. + * + * @return known ExportFormatType values. + */ + public static Collection values() { + return values(ExportFormatType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportSummary.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportSummary.java new file mode 100644 index 0000000000000..4978cbaefd1c9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExportSummary.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ExportSummary. */ +public interface ExportSummary { + /** + * Gets the endDateTime property: The time when the export was completed. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the exportedRowCount property: The total number of labeled datapoints exported. + * + * @return the exportedRowCount value. + */ + Long exportedRowCount(); + + /** + * Gets the labelingJobId property: Name and identifier of the job containing exported labels. + * + * @return the labelingJobId value. + */ + String labelingJobId(); + + /** + * Gets the startDateTime property: The time when the export was requested. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner object. + * + * @return the inner object. + */ + ExportSummaryInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java index 6483d490175f8..9fd056b3a5e04 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java @@ -14,7 +14,7 @@ public interface ExternalFqdnResponse { * * @return the value value. */ - List value(); + List value(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner object. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java new file mode 100644 index 0000000000000..9a5ba337f4581 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; + +/** An immutable client-side representation of Feature. */ +public interface Feature { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeatureProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner object. + * + * @return the inner object. + */ + FeatureInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java new file mode 100644 index 0000000000000..ec237205e2bf9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The FeatureAttributionDriftMonitoringSignal model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("FeatureAttributionDrift") +@Fluent +public final class FeatureAttributionDriftMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThreshold", required = true) + private FeatureAttributionMetricThreshold metricThreshold; + + /* + * [Required] The data which drift will be calculated for. + */ + @JsonProperty(value = "productionData", required = true) + private List productionData; + + /* + * [Required] The data to calculate drift against. + */ + @JsonProperty(value = "referenceData", required = true) + private MonitoringInputDataBase referenceData; + + /** Creates an instance of FeatureAttributionDriftMonitoringSignal class. */ + public FeatureAttributionDriftMonitoringSignal() { + } + + /** + * Get the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThreshold value. + */ + public FeatureAttributionMetricThreshold metricThreshold() { + return this.metricThreshold; + } + + /** + * Set the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThreshold the metricThreshold value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal withMetricThreshold( + FeatureAttributionMetricThreshold metricThreshold) { + this.metricThreshold = metricThreshold; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public List productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal withProductionData(List productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** {@inheritDoc} */ + @Override + public FeatureAttributionDriftMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeatureAttributionDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metricThreshold() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThreshold in model FeatureAttributionDriftMonitoringSignal")); + } else { + metricThreshold().validate(); + } + if (productionData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productionData in model FeatureAttributionDriftMonitoringSignal")); + } else { + productionData().forEach(e -> e.validate()); + } + if (referenceData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property referenceData in model FeatureAttributionDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureAttributionDriftMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java new file mode 100644 index 0000000000000..46c0dbc8e4190 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeatureAttributionMetric. */ +public final class FeatureAttributionMetric extends ExpandableStringEnum { + /** Static value NormalizedDiscountedCumulativeGain for FeatureAttributionMetric. */ + public static final FeatureAttributionMetric NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = + fromString("NormalizedDiscountedCumulativeGain"); + + /** + * Creates a new instance of FeatureAttributionMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureAttributionMetric() { + } + + /** + * Creates or finds a FeatureAttributionMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureAttributionMetric. + */ + @JsonCreator + public static FeatureAttributionMetric fromString(String name) { + return fromString(name, FeatureAttributionMetric.class); + } + + /** + * Gets known FeatureAttributionMetric values. + * + * @return known FeatureAttributionMetric values. + */ + public static Collection values() { + return values(FeatureAttributionMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java new file mode 100644 index 0000000000000..0f49bbe4e2328 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FeatureAttributionMetricThreshold model. */ +@Fluent +public final class FeatureAttributionMetricThreshold { + /* + * [Required] The feature attribution metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private FeatureAttributionMetric metric; + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of FeatureAttributionMetricThreshold class. */ + public FeatureAttributionMetricThreshold() { + } + + /** + * Get the metric property: [Required] The feature attribution metric to calculate. + * + * @return the metric value. + */ + public FeatureAttributionMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The feature attribution metric to calculate. + * + * @param metric the metric value to set. + * @return the FeatureAttributionMetricThreshold object itself. + */ + public FeatureAttributionMetricThreshold withMetric(FeatureAttributionMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the FeatureAttributionMetricThreshold object itself. + */ + public FeatureAttributionMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model FeatureAttributionMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureAttributionMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java new file mode 100644 index 0000000000000..9ed9e1d0edc75 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeatureDataType. */ +public final class FeatureDataType extends ExpandableStringEnum { + /** Static value String for FeatureDataType. */ + public static final FeatureDataType STRING = fromString("String"); + + /** Static value Integer for FeatureDataType. */ + public static final FeatureDataType INTEGER = fromString("Integer"); + + /** Static value Long for FeatureDataType. */ + public static final FeatureDataType LONG = fromString("Long"); + + /** Static value Float for FeatureDataType. */ + public static final FeatureDataType FLOAT = fromString("Float"); + + /** Static value Double for FeatureDataType. */ + public static final FeatureDataType DOUBLE = fromString("Double"); + + /** Static value Binary for FeatureDataType. */ + public static final FeatureDataType BINARY = fromString("Binary"); + + /** Static value Datetime for FeatureDataType. */ + public static final FeatureDataType DATETIME = fromString("Datetime"); + + /** Static value Boolean for FeatureDataType. */ + public static final FeatureDataType BOOLEAN = fromString("Boolean"); + + /** + * Creates a new instance of FeatureDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureDataType() { + } + + /** + * Creates or finds a FeatureDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureDataType. + */ + @JsonCreator + public static FeatureDataType fromString(String name) { + return fromString(name, FeatureDataType.class); + } + + /** + * Gets known FeatureDataType values. + * + * @return known FeatureDataType values. + */ + public static Collection values() { + return values(FeatureDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java new file mode 100644 index 0000000000000..e8ea106e073d5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Dto object representing feature. */ +@Fluent +public final class FeatureProperties extends ResourceBase { + /* + * Specifies type + */ + @JsonProperty(value = "dataType") + private FeatureDataType dataType; + + /* + * Specifies name + */ + @JsonProperty(value = "featureName") + private String featureName; + + /** Creates an instance of FeatureProperties class. */ + public FeatureProperties() { + } + + /** + * Get the dataType property: Specifies type. + * + * @return the dataType value. + */ + public FeatureDataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Specifies type. + * + * @param dataType the dataType value to set. + * @return the FeatureProperties object itself. + */ + public FeatureProperties withDataType(FeatureDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the featureName property: Specifies name. + * + * @return the featureName value. + */ + public String featureName() { + return this.featureName; + } + + /** + * Set the featureName property: Specifies name. + * + * @param featureName the featureName value to set. + * @return the FeatureProperties object itself. + */ + public FeatureProperties withFeatureName(String featureName) { + this.featureName = featureName; + return this; + } + + /** {@inheritDoc} */ + @Override + public FeatureProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeatureProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeatureProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..3cc7408851cbf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of Feature entities. */ +@Fluent +public final class FeatureResourceArmPaginatedResult { + /* + * The link to the next page of Feature objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type Feature. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeatureResourceArmPaginatedResult class. */ + public FeatureResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Feature objects. If null, there are no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of Feature objects. If null, there are no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeatureResourceArmPaginatedResult object itself. + */ + public FeatureResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type Feature. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type Feature. + * + * @param value the value value to set. + * @return the FeatureResourceArmPaginatedResult object itself. + */ + public FeatureResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java new file mode 100644 index 0000000000000..c51120b68b9d3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FeatureStoreSettings model. */ +@Fluent +public final class FeatureStoreSettings { + /* + * The computeRuntime property. + */ + @JsonProperty(value = "computeRuntime") + private ComputeRuntimeDto computeRuntime; + + /* + * The offlineStoreConnectionName property. + */ + @JsonProperty(value = "offlineStoreConnectionName") + private String offlineStoreConnectionName; + + /* + * The onlineStoreConnectionName property. + */ + @JsonProperty(value = "onlineStoreConnectionName") + private String onlineStoreConnectionName; + + /** Creates an instance of FeatureStoreSettings class. */ + public FeatureStoreSettings() { + } + + /** + * Get the computeRuntime property: The computeRuntime property. + * + * @return the computeRuntime value. + */ + public ComputeRuntimeDto computeRuntime() { + return this.computeRuntime; + } + + /** + * Set the computeRuntime property: The computeRuntime property. + * + * @param computeRuntime the computeRuntime value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withComputeRuntime(ComputeRuntimeDto computeRuntime) { + this.computeRuntime = computeRuntime; + return this; + } + + /** + * Get the offlineStoreConnectionName property: The offlineStoreConnectionName property. + * + * @return the offlineStoreConnectionName value. + */ + public String offlineStoreConnectionName() { + return this.offlineStoreConnectionName; + } + + /** + * Set the offlineStoreConnectionName property: The offlineStoreConnectionName property. + * + * @param offlineStoreConnectionName the offlineStoreConnectionName value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withOfflineStoreConnectionName(String offlineStoreConnectionName) { + this.offlineStoreConnectionName = offlineStoreConnectionName; + return this; + } + + /** + * Get the onlineStoreConnectionName property: The onlineStoreConnectionName property. + * + * @return the onlineStoreConnectionName value. + */ + public String onlineStoreConnectionName() { + return this.onlineStoreConnectionName; + } + + /** + * Set the onlineStoreConnectionName property: The onlineStoreConnectionName property. + * + * @param onlineStoreConnectionName the onlineStoreConnectionName value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withOnlineStoreConnectionName(String onlineStoreConnectionName) { + this.onlineStoreConnectionName = onlineStoreConnectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeRuntime() != null) { + computeRuntime().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java new file mode 100644 index 0000000000000..b2b924ea39976 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The FeatureSubset model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "filterType") +@JsonTypeName("FeatureSubset") +@Fluent +public final class FeatureSubset extends MonitoringFeatureFilterBase { + /* + * [Required] The list of features to include. + */ + @JsonProperty(value = "features", required = true) + private List features; + + /** Creates an instance of FeatureSubset class. */ + public FeatureSubset() { + } + + /** + * Get the features property: [Required] The list of features to include. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: [Required] The list of features to include. + * + * @param features the features value to set. + * @return the FeatureSubset object itself. + */ + public FeatureSubset withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (features() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property features in model FeatureSubset")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureSubset.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java new file mode 100644 index 0000000000000..27748bf697d3a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Specifies the feature window. */ +@Fluent +public final class FeatureWindow { + /* + * Specifies the feature window end time + */ + @JsonProperty(value = "featureWindowEnd") + private OffsetDateTime featureWindowEnd; + + /* + * Specifies the feature window start time + */ + @JsonProperty(value = "featureWindowStart") + private OffsetDateTime featureWindowStart; + + /** Creates an instance of FeatureWindow class. */ + public FeatureWindow() { + } + + /** + * Get the featureWindowEnd property: Specifies the feature window end time. + * + * @return the featureWindowEnd value. + */ + public OffsetDateTime featureWindowEnd() { + return this.featureWindowEnd; + } + + /** + * Set the featureWindowEnd property: Specifies the feature window end time. + * + * @param featureWindowEnd the featureWindowEnd value to set. + * @return the FeatureWindow object itself. + */ + public FeatureWindow withFeatureWindowEnd(OffsetDateTime featureWindowEnd) { + this.featureWindowEnd = featureWindowEnd; + return this; + } + + /** + * Get the featureWindowStart property: Specifies the feature window start time. + * + * @return the featureWindowStart value. + */ + public OffsetDateTime featureWindowStart() { + return this.featureWindowStart; + } + + /** + * Set the featureWindowStart property: Specifies the feature window start time. + * + * @param featureWindowStart the featureWindowStart value to set. + * @return the FeatureWindow object itself. + */ + public FeatureWindow withFeatureWindowStart(OffsetDateTime featureWindowStart) { + this.featureWindowStart = featureWindowStart; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java new file mode 100644 index 0000000000000..6e6b9cf3a494e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Features. */ +public interface Features { + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion); + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String skip, + String tags, + String featureName, + String description, + Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName, + Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + Feature get( + String resourceGroupName, + String workspaceName, + String featuresetName, + String featuresetVersion, + String featureName); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java new file mode 100644 index 0000000000000..5ecba34b69b07 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; + +/** An immutable client-side representation of FeaturesetContainer. */ +public interface FeaturesetContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturesetContainerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner object. + * + * @return the inner object. + */ + FeaturesetContainerInner innerModel(); + + /** The entirety of the FeaturesetContainer definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The FeaturesetContainer definition stages. */ + interface DefinitionStages { + /** The first stage of the FeaturesetContainer definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the FeaturesetContainer definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** The stage of the FeaturesetContainer definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturesetContainerProperties properties); + } + + /** + * The stage of the FeaturesetContainer definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturesetContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturesetContainer create(Context context); + } + } + + /** + * Begins update for the FeaturesetContainer resource. + * + * @return the stage of resource update. + */ + FeaturesetContainer.Update update(); + + /** The template for FeaturesetContainer update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturesetContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturesetContainer apply(Context context); + } + + /** The FeaturesetContainer update stages. */ + interface UpdateStages { + /** The stage of the FeaturesetContainer update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturesetContainerProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturesetContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturesetContainer refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java new file mode 100644 index 0000000000000..31622d2b65582 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Dto object representing feature set. */ +@Fluent +public final class FeaturesetContainerProperties extends AssetContainer { + /* + * Provisioning state for the featureset container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /** Creates an instance of FeaturesetContainerProperties class. */ + public FeaturesetContainerProperties() { + } + + /** + * Get the provisioningState property: Provisioning state for the featureset container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetContainerProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetContainerProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetContainerProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetContainerProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..29713ce04d4f0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of FeaturesetContainer entities. */ +@Fluent +public final class FeaturesetContainerResourceArmPaginatedResult { + /* + * The link to the next page of FeaturesetContainer objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type FeaturesetContainer. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeaturesetContainerResourceArmPaginatedResult class. */ + public FeaturesetContainerResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturesetContainer objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturesetContainer objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturesetContainerResourceArmPaginatedResult object itself. + */ + public FeaturesetContainerResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturesetContainer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturesetContainer. + * + * @param value the value value to set. + * @return the FeaturesetContainerResourceArmPaginatedResult object itself. + */ + public FeaturesetContainerResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java new file mode 100644 index 0000000000000..9a10b56cc231f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FeaturesetContainers. */ +public interface FeaturesetContainers { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + FeaturesetContainer getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + FeaturesetContainer getEntityById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturesetContainer resource. + * + * @param name resource name. + * @return the first stage of the new FeaturesetContainer definition. + */ + FeaturesetContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJob.java new file mode 100644 index 0000000000000..75a1eaa36045f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJob.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of FeaturesetJob. */ +public interface FeaturesetJob { + /** + * Gets the createdDate property: Specifies the created date. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the displayName property: Specifies the display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the duration property: Specifies the duration. + * + * @return the duration value. + */ + Duration duration(); + + /** + * Gets the experimentId property: Specifies the experiment id. + * + * @return the experimentId value. + */ + String experimentId(); + + /** + * Gets the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @return the featureWindow value. + */ + FeatureWindow featureWindow(); + + /** + * Gets the jobId property: Specifies the job id. + * + * @return the jobId value. + */ + String jobId(); + + /** + * Gets the status property: Specifies the job status. + * + * @return the status value. + */ + JobStatus status(); + + /** + * Gets the tags property: Specifies the tags if any. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the type property: Specifies the feature store job type. + * + * @return the type value. + */ + FeaturestoreJobType type(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner object. + * + * @return the inner object. + */ + FeaturesetJobInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJobArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJobArmPaginatedResult.java new file mode 100644 index 0000000000000..7ddc3c43363e1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetJobArmPaginatedResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetJobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of FeaturesetJob entities. */ +@Fluent +public final class FeaturesetJobArmPaginatedResult { + /* + * The link to the next page of FeaturesetJob objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type FeaturesetJob. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeaturesetJobArmPaginatedResult class. */ + public FeaturesetJobArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturesetJob objects. If null, there are no additional + * pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturesetJob objects. If null, there are no additional + * pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturesetJobArmPaginatedResult object itself. + */ + public FeaturesetJobArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturesetJob. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturesetJob. + * + * @param value the value value to set. + * @return the FeaturesetJobArmPaginatedResult object itself. + */ + public FeaturesetJobArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java new file mode 100644 index 0000000000000..50f00e0347990 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dto object representing specification. */ +@Fluent +public final class FeaturesetSpecification { + /* + * Specifies the spec path + */ + @JsonProperty(value = "path") + private String path; + + /** Creates an instance of FeaturesetSpecification class. */ + public FeaturesetSpecification() { + } + + /** + * Get the path property: Specifies the spec path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the spec path. + * + * @param path the path value to set. + * @return the FeaturesetSpecification object itself. + */ + public FeaturesetSpecification withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java new file mode 100644 index 0000000000000..d2ff10bc07dab --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; + +/** An immutable client-side representation of FeaturesetVersion. */ +public interface FeaturesetVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturesetVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner object. + * + * @return the inner object. + */ + FeaturesetVersionInner innerModel(); + + /** The entirety of the FeaturesetVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The FeaturesetVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the FeaturesetVersion definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the FeaturesetVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @return the next definition stage. + */ + WithProperties withExistingFeatureset(String resourceGroupName, String workspaceName, String name); + } + + /** The stage of the FeaturesetVersion definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturesetVersionProperties properties); + } + + /** + * The stage of the FeaturesetVersion definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturesetVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturesetVersion create(Context context); + } + } + + /** + * Begins update for the FeaturesetVersion resource. + * + * @return the stage of resource update. + */ + FeaturesetVersion.Update update(); + + /** The template for FeaturesetVersion update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturesetVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturesetVersion apply(Context context); + } + + /** The FeaturesetVersion update stages. */ + interface UpdateStages { + /** The stage of the FeaturesetVersion update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturesetVersionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturesetVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturesetVersion refresh(Context context); + + /** + * Backfill. + * + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + FeaturesetJob backfill(FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + FeaturesetJob backfill(FeaturesetVersionBackfillRequest body, Context context); + + /** + * List materialization Jobs. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listMaterializationJobs(); + + /** + * List materialization Jobs. + * + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listMaterializationJobs( + String skip, String filters, String featureWindowStart, String featureWindowEnd, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java new file mode 100644 index 0000000000000..fe22785407a9f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Request payload for creating a backfill request for a given feature set version. */ +@Fluent +public final class FeaturesetVersionBackfillRequest { + /* + * Specifies description + */ + @JsonProperty(value = "description") + private String description; + + /* + * Specifies description + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Specifies the backfill feature window to be materialized + */ + @JsonProperty(value = "featureWindow") + private FeatureWindow featureWindow; + + /* + * Specifies the compute resource settings + */ + @JsonProperty(value = "resource") + private MaterializationComputeResource resource; + + /* + * Specifies the spark compute settings + */ + @JsonProperty(value = "sparkConfiguration") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map sparkConfiguration; + + /* + * Specifies the tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of FeaturesetVersionBackfillRequest class. */ + public FeaturesetVersionBackfillRequest() { + } + + /** + * Get the description property: Specifies description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Specifies description. + * + * @param description the description value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: Specifies description. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Specifies description. + * + * @param displayName the displayName value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @return the featureWindow value. + */ + public FeatureWindow featureWindow() { + return this.featureWindow; + } + + /** + * Set the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @param featureWindow the featureWindow value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withFeatureWindow(FeatureWindow featureWindow) { + this.featureWindow = featureWindow; + return this; + } + + /** + * Get the resource property: Specifies the compute resource settings. + * + * @return the resource value. + */ + public MaterializationComputeResource resource() { + return this.resource; + } + + /** + * Set the resource property: Specifies the compute resource settings. + * + * @param resource the resource value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withResource(MaterializationComputeResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the sparkConfiguration property: Specifies the spark compute settings. + * + * @return the sparkConfiguration value. + */ + public Map sparkConfiguration() { + return this.sparkConfiguration; + } + + /** + * Set the sparkConfiguration property: Specifies the spark compute settings. + * + * @param sparkConfiguration the sparkConfiguration value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withSparkConfiguration(Map sparkConfiguration) { + this.sparkConfiguration = sparkConfiguration; + return this; + } + + /** + * Get the tags property: Specifies the tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Specifies the tags. + * + * @param tags the tags value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featureWindow() != null) { + featureWindow().validate(); + } + if (resource() != null) { + resource().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java new file mode 100644 index 0000000000000..017bae18b4315 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Dto object representing feature set version. */ +@Fluent +public final class FeaturesetVersionProperties extends AssetBase { + /* + * Specifies list of entities + */ + @JsonProperty(value = "entities") + private List entities; + + /* + * Specifies the materialization settings + */ + @JsonProperty(value = "materializationSettings") + private MaterializationSettings materializationSettings; + + /* + * Provisioning state for the featureset version container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /* + * Specifies the feature spec details + */ + @JsonProperty(value = "specification") + private FeaturesetSpecification specification; + + /* + * Specifies the asset stage + */ + @JsonProperty(value = "stage") + private String stage; + + /** Creates an instance of FeaturesetVersionProperties class. */ + public FeaturesetVersionProperties() { + } + + /** + * Get the entities property: Specifies list of entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities property: Specifies list of entities. + * + * @param entities the entities value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the materializationSettings property: Specifies the materialization settings. + * + * @return the materializationSettings value. + */ + public MaterializationSettings materializationSettings() { + return this.materializationSettings; + } + + /** + * Set the materializationSettings property: Specifies the materialization settings. + * + * @param materializationSettings the materializationSettings value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withMaterializationSettings(MaterializationSettings materializationSettings) { + this.materializationSettings = materializationSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the featureset version container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the specification property: Specifies the feature spec details. + * + * @return the specification value. + */ + public FeaturesetSpecification specification() { + return this.specification; + } + + /** + * Set the specification property: Specifies the feature spec details. + * + * @param specification the specification value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withSpecification(FeaturesetSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Get the stage property: Specifies the asset stage. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Specifies the asset stage. + * + * @param stage the stage value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withIsAnonymous(Boolean isAnonymous) { + super.withIsAnonymous(isAnonymous); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturesetVersionProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (materializationSettings() != null) { + materializationSettings().validate(); + } + if (specification() != null) { + specification().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..05ac0a9e642f4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of FeaturesetVersion entities. */ +@Fluent +public final class FeaturesetVersionResourceArmPaginatedResult { + /* + * The link to the next page of FeaturesetVersion objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type FeaturesetVersion. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeaturesetVersionResourceArmPaginatedResult class. */ + public FeaturesetVersionResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturesetVersion objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturesetVersion objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturesetVersionResourceArmPaginatedResult object itself. + */ + public FeaturesetVersionResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturesetVersion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturesetVersion. + * + * @param value the value value to set. + * @return the FeaturesetVersionResourceArmPaginatedResult object itself. + */ + public FeaturesetVersionResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java new file mode 100644 index 0000000000000..aa7ec0e7e19ba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FeaturesetVersions. */ +public interface FeaturesetVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + FeaturesetVersion get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + FeaturesetJob backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dto object representing the feature set job. + */ + FeaturesetJob backfill( + String resourceGroupName, + String workspaceName, + String name, + String version, + FeaturesetVersionBackfillRequest body, + Context context); + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listMaterializationJobs( + String resourceGroupName, String workspaceName, String name, String version); + + /** + * List materialization Jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param filters Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureWindowStart Start time of the feature window to filter materialization jobs. + * @param featureWindowEnd End time of the feature window to filter materialization jobs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listMaterializationJobs( + String resourceGroupName, + String workspaceName, + String name, + String version, + String skip, + String filters, + String featureWindowStart, + String featureWindowEnd, + Context context); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + FeaturesetVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturesetVersion resource. + * + * @param name resource name. + * @return the first stage of the new FeaturesetVersion definition. + */ + FeaturesetVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java new file mode 100644 index 0000000000000..c7ea18bbe1407 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; + +/** An immutable client-side representation of FeaturestoreEntityContainer. */ +public interface FeaturestoreEntityContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturestoreEntityContainerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner object. + * + * @return the inner object. + */ + FeaturestoreEntityContainerInner innerModel(); + + /** The entirety of the FeaturestoreEntityContainer definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The FeaturestoreEntityContainer definition stages. */ + interface DefinitionStages { + /** The first stage of the FeaturestoreEntityContainer definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the FeaturestoreEntityContainer definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** The stage of the FeaturestoreEntityContainer definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturestoreEntityContainerProperties properties); + } + + /** + * The stage of the FeaturestoreEntityContainer definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturestoreEntityContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturestoreEntityContainer create(Context context); + } + } + + /** + * Begins update for the FeaturestoreEntityContainer resource. + * + * @return the stage of resource update. + */ + FeaturestoreEntityContainer.Update update(); + + /** The template for FeaturestoreEntityContainer update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturestoreEntityContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturestoreEntityContainer apply(Context context); + } + + /** The FeaturestoreEntityContainer update stages. */ + interface UpdateStages { + /** The stage of the FeaturestoreEntityContainer update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturestoreEntityContainerProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturestoreEntityContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturestoreEntityContainer refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java new file mode 100644 index 0000000000000..648dc1ed9d829 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Dto object representing feature entity. */ +@Fluent +public final class FeaturestoreEntityContainerProperties extends AssetContainer { + /* + * Provisioning state for the featurestore entity container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /** Creates an instance of FeaturestoreEntityContainerProperties class. */ + public FeaturestoreEntityContainerProperties() { + } + + /** + * Get the provisioningState property: Provisioning state for the featurestore entity container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityContainerProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityContainerProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityContainerProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityContainerProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..301680ec6bae7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of FeaturestoreEntityContainer entities. */ +@Fluent +public final class FeaturestoreEntityContainerResourceArmPaginatedResult { + /* + * The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type FeaturestoreEntityContainer. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeaturestoreEntityContainerResourceArmPaginatedResult class. */ + public FeaturestoreEntityContainerResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturestoreEntityContainer objects. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturestoreEntityContainer objects. If null, there are + * no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturestoreEntityContainerResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityContainerResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturestoreEntityContainer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturestoreEntityContainer. + * + * @param value the value value to set. + * @return the FeaturestoreEntityContainerResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityContainerResourceArmPaginatedResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java new file mode 100644 index 0000000000000..3eb9cd2dc050b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FeaturestoreEntityContainers. */ +public interface FeaturestoreEntityContainers { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String name, + String description, + String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityWithResponse( + String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + FeaturestoreEntityContainer getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + FeaturestoreEntityContainer getEntityById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturestoreEntityContainer resource. + * + * @param name resource name. + * @return the first stage of the new FeaturestoreEntityContainer definition. + */ + FeaturestoreEntityContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java new file mode 100644 index 0000000000000..dde6c4f8200b8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; + +/** An immutable client-side representation of FeaturestoreEntityVersion. */ +public interface FeaturestoreEntityVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturestoreEntityVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner object. + * + * @return the inner object. + */ + FeaturestoreEntityVersionInner innerModel(); + + /** The entirety of the FeaturestoreEntityVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The FeaturestoreEntityVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the FeaturestoreEntityVersion definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the FeaturestoreEntityVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @return the next definition stage. + */ + WithProperties withExistingFeaturestoreEntity(String resourceGroupName, String workspaceName, String name); + } + + /** The stage of the FeaturestoreEntityVersion definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturestoreEntityVersionProperties properties); + } + + /** + * The stage of the FeaturestoreEntityVersion definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturestoreEntityVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturestoreEntityVersion create(Context context); + } + } + + /** + * Begins update for the FeaturestoreEntityVersion resource. + * + * @return the stage of resource update. + */ + FeaturestoreEntityVersion.Update update(); + + /** The template for FeaturestoreEntityVersion update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturestoreEntityVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturestoreEntityVersion apply(Context context); + } + + /** The FeaturestoreEntityVersion update stages. */ + interface UpdateStages { + /** The stage of the FeaturestoreEntityVersion update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturestoreEntityVersionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturestoreEntityVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturestoreEntityVersion refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java new file mode 100644 index 0000000000000..1e9808885a6c6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Dto object representing feature entity version. */ +@Fluent +public final class FeaturestoreEntityVersionProperties extends AssetBase { + /* + * Specifies index columns + */ + @JsonProperty(value = "indexColumns") + private List indexColumns; + + /* + * Provisioning state for the featurestore entity version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /* + * Specifies the asset stage + */ + @JsonProperty(value = "stage") + private String stage; + + /** Creates an instance of FeaturestoreEntityVersionProperties class. */ + public FeaturestoreEntityVersionProperties() { + } + + /** + * Get the indexColumns property: Specifies index columns. + * + * @return the indexColumns value. + */ + public List indexColumns() { + return this.indexColumns; + } + + /** + * Set the indexColumns property: Specifies index columns. + * + * @param indexColumns the indexColumns value to set. + * @return the FeaturestoreEntityVersionProperties object itself. + */ + public FeaturestoreEntityVersionProperties withIndexColumns(List indexColumns) { + this.indexColumns = indexColumns; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the featurestore entity version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Specifies the asset stage. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Specifies the asset stage. + * + * @param stage the stage value to set. + * @return the FeaturestoreEntityVersionProperties object itself. + */ + public FeaturestoreEntityVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withIsAnonymous(Boolean isAnonymous) { + super.withIsAnonymous(isAnonymous); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public FeaturestoreEntityVersionProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (indexColumns() != null) { + indexColumns().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..5e58d211929a1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of FeaturestoreEntityVersion entities. */ +@Fluent +public final class FeaturestoreEntityVersionResourceArmPaginatedResult { + /* + * The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type FeaturestoreEntityVersion. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of FeaturestoreEntityVersionResourceArmPaginatedResult class. */ + public FeaturestoreEntityVersionResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturestoreEntityVersion objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturestoreEntityVersion objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturestoreEntityVersionResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityVersionResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturestoreEntityVersion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturestoreEntityVersion. + * + * @param value the value value to set. + * @return the FeaturestoreEntityVersionResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityVersionResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java new file mode 100644 index 0000000000000..ac88a153c50ed --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FeaturestoreEntityVersions. */ +public interface FeaturestoreEntityVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String name, + String skip, + String tags, + ListViewType listViewType, + Integer pageSize, + String versionName, + String version, + String description, + String createdBy, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + FeaturestoreEntityVersion get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + FeaturestoreEntityVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturestoreEntityVersion resource. + * + * @param name resource name. + * @return the first stage of the new FeaturestoreEntityVersion definition. + */ + FeaturestoreEntityVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreJobType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreJobType.java new file mode 100644 index 0000000000000..35f3837e1d626 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreJobType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeaturestoreJobType. */ +public final class FeaturestoreJobType extends ExpandableStringEnum { + /** Static value RecurrentMaterialization for FeaturestoreJobType. */ + public static final FeaturestoreJobType RECURRENT_MATERIALIZATION = fromString("RecurrentMaterialization"); + + /** Static value BackfillMaterialization for FeaturestoreJobType. */ + public static final FeaturestoreJobType BACKFILL_MATERIALIZATION = fromString("BackfillMaterialization"); + + /** + * Creates a new instance of FeaturestoreJobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeaturestoreJobType() { + } + + /** + * Creates or finds a FeaturestoreJobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeaturestoreJobType. + */ + @JsonCreator + public static FeaturestoreJobType fromString(String name) { + return fromString(name, FeaturestoreJobType.class); + } + + /** + * Gets known FeaturestoreJobType values. + * + * @return known FeaturestoreJobType values. + */ + public static Collection values() { + return values(FeaturestoreJobType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FileSystemSource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FileSystemSource.java new file mode 100644 index 0000000000000..ae4508440c423 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FileSystemSource.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The FileSystemSource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "sourceType") +@JsonTypeName("file_system") +@Fluent +public final class FileSystemSource extends DataImportSource { + /* + * Path on data import FileSystem source + */ + @JsonProperty(value = "path") + private String path; + + /** Creates an instance of FileSystemSource class. */ + public FileSystemSource() { + } + + /** + * Get the path property: Path on data import FileSystem source. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path on data import FileSystem source. + * + * @param path the path value to set. + * @return the FileSystemSource object itself. + */ + public FileSystemSource withPath(String path) { + this.path = path; + return this; + } + + /** {@inheritDoc} */ + @Override + public FileSystemSource withConnection(String connection) { + super.withConnection(connection); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java new file mode 100644 index 0000000000000..d9fa247d681b5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Fixed input data definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputDataType") +@JsonTypeName("Fixed") +@Fluent +public final class FixedInputData extends MonitoringInputDataBase { + /** Creates an instance of FixedInputData class. */ + public FixedInputData() { + } + + /** {@inheritDoc} */ + @Override + public FixedInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** {@inheritDoc} */ + @Override + public FixedInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** {@inheritDoc} */ + @Override + public FixedInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** {@inheritDoc} */ + @Override + public FixedInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java index 0f9bf8e05d7ed..0d6c8e57787ee 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java @@ -45,6 +45,12 @@ public final class Forecasting extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private TableFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @@ -58,6 +64,18 @@ public final class Forecasting extends AutoMLVertical { @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private TableSweepSettings sweepSettings; + /* * Test data input. */ @@ -197,6 +215,26 @@ public Forecasting withFeaturizationSettings(TableVerticalFeaturizationSettings return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public TableFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the Forecasting object itself. + */ + public Forecasting withFixedParameters(TableFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -239,6 +277,48 @@ public Forecasting withNCrossValidations(NCrossValidations nCrossValidations) { return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the Forecasting object itself. + */ + public Forecasting withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public TableSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the Forecasting object itself. + */ + public Forecasting withSweepSettings(TableSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the testData property: Test data input. * @@ -383,12 +463,21 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } if (nCrossValidations() != null) { nCrossValidations().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (testData() != null) { testData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java index b611d6da822aa..99cea9c1a9655 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java @@ -32,6 +32,14 @@ public final class ForecastingSettings { @JsonProperty(value = "featureLags") private FeatureLags featureLags; + /* + * The feature columns that are available for training but unknown at the time of forecast/inference. + * If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are + * known at inference time. + */ + @JsonProperty(value = "featuresUnknownAtForecastTime") + private List featuresUnknownAtForecastTime; + /* * The desired maximum forecast horizon in units of time-series frequency. */ @@ -167,6 +175,30 @@ public ForecastingSettings withFeatureLags(FeatureLags featureLags) { return this; } + /** + * Get the featuresUnknownAtForecastTime property: The feature columns that are available for training but unknown + * at the time of forecast/inference. If features_unknown_at_forecast_time is not set, it is assumed that all the + * feature columns in the dataset are known at inference time. + * + * @return the featuresUnknownAtForecastTime value. + */ + public List featuresUnknownAtForecastTime() { + return this.featuresUnknownAtForecastTime; + } + + /** + * Set the featuresUnknownAtForecastTime property: The feature columns that are available for training but unknown + * at the time of forecast/inference. If features_unknown_at_forecast_time is not set, it is assumed that all the + * feature columns in the dataset are known at inference time. + * + * @param featuresUnknownAtForecastTime the featuresUnknownAtForecastTime value to set. + * @return the ForecastingSettings object itself. + */ + public ForecastingSettings withFeaturesUnknownAtForecastTime(List featuresUnknownAtForecastTime) { + this.featuresUnknownAtForecastTime = featuresUnknownAtForecastTime; + return this; + } + /** * Get the forecastHorizon property: The desired maximum forecast horizon in units of time-series frequency. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java index baf43d0f6fbfe..02cf18f342d41 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java @@ -119,6 +119,13 @@ public ForecastingTrainingSettings withStackEnsembleSettings(StackEnsembleSettin return this; } + /** {@inheritDoc} */ + @Override + public ForecastingTrainingSettings withTrainingMode(TrainingMode trainingMode) { + super.withTrainingMode(trainingMode); + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java index e858af2ff0011..5eec10e88eb78 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java @@ -6,37 +6,64 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** The FqdnEndpoints model. */ @Fluent public final class FqdnEndpoints { /* - * The properties property. + * The category property. */ - @JsonProperty(value = "properties") - private FqdnEndpointsProperties properties; + @JsonProperty(value = "category") + private String category; + + /* + * The endpoints property. + */ + @JsonProperty(value = "endpoints") + private List endpoints; /** Creates an instance of FqdnEndpoints class. */ public FqdnEndpoints() { } /** - * Get the properties property: The properties property. + * Get the category property: The category property. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category property. + * + * @param category the category value to set. + * @return the FqdnEndpoints object itself. + */ + public FqdnEndpoints withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the endpoints property: The endpoints property. * - * @return the properties value. + * @return the endpoints value. */ - public FqdnEndpointsProperties properties() { - return this.properties; + public List endpoints() { + return this.endpoints; } /** - * Set the properties property: The properties property. + * Set the endpoints property: The endpoints property. * - * @param properties the properties value to set. + * @param endpoints the endpoints value to set. * @return the FqdnEndpoints object itself. */ - public FqdnEndpoints withProperties(FqdnEndpointsProperties properties) { - this.properties = properties; + public FqdnEndpoints withEndpoints(List endpoints) { + this.endpoints = endpoints; return this; } @@ -46,8 +73,8 @@ public FqdnEndpoints withProperties(FqdnEndpointsProperties properties) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java deleted file mode 100644 index 6cf5fe68fb945..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The FqdnEndpointsProperties model. */ -@Fluent -public final class FqdnEndpointsProperties { - /* - * The category property. - */ - @JsonProperty(value = "category") - private String category; - - /* - * The endpoints property. - */ - @JsonProperty(value = "endpoints") - private List endpoints; - - /** Creates an instance of FqdnEndpointsProperties class. */ - public FqdnEndpointsProperties() { - } - - /** - * Get the category property: The category property. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The category property. - * - * @param category the category value to set. - * @return the FqdnEndpointsProperties object itself. - */ - public FqdnEndpointsProperties withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the endpoints property: The endpoints property. - * - * @return the endpoints value. - */ - public List endpoints() { - return this.endpoints; - } - - /** - * Set the endpoints property: The endpoints property. - * - * @param endpoints the endpoints value to set. - * @return the FqdnEndpointsProperties object itself. - */ - public FqdnEndpointsProperties withEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endpoints() != null) { - endpoints().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsPropertyBag.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsPropertyBag.java new file mode 100644 index 0000000000000..fca7f6702030e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsPropertyBag.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Property bag for FQDN endpoints result. */ +@Fluent +public final class FqdnEndpointsPropertyBag { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private FqdnEndpoints properties; + + /** Creates an instance of FqdnEndpointsPropertyBag class. */ + public FqdnEndpointsPropertyBag() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public FqdnEndpoints properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the FqdnEndpointsPropertyBag object itself. + */ + public FqdnEndpointsPropertyBag withProperties(FqdnEndpoints properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java new file mode 100644 index 0000000000000..16d46830ce1c1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** FQDN Outbound Rule for the managed network of a machine learning workspace. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("FQDN") +@Fluent +public final class FqdnOutboundRule extends OutboundRule { + /* + * The destination property. + */ + @JsonProperty(value = "destination") + private String destination; + + /** Creates an instance of FqdnOutboundRule class. */ + public FqdnOutboundRule() { + } + + /** + * Get the destination property: The destination property. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: The destination property. + * + * @param destination the destination value to set. + * @return the FqdnOutboundRule object itself. + */ + public FqdnOutboundRule withDestination(String destination) { + this.destination = destination; + return this; + } + + /** {@inheritDoc} */ + @Override + public FqdnOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public FqdnOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetric.java new file mode 100644 index 0000000000000..118fc20ab821e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetric.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Generation safety quality metric enum. */ +public final class GenerationSafetyQualityMetric extends ExpandableStringEnum { + /** Static value AcceptableGroundednessScorePerInstance for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = + fromString("AcceptableGroundednessScorePerInstance"); + + /** Static value AggregatedGroundednessPassRate for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric AGGREGATED_GROUNDEDNESS_PASS_RATE = + fromString("AggregatedGroundednessPassRate"); + + /** Static value AcceptableCoherenceScorePerInstance for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = + fromString("AcceptableCoherenceScorePerInstance"); + + /** Static value AggregatedCoherencePassRate for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric AGGREGATED_COHERENCE_PASS_RATE = + fromString("AggregatedCoherencePassRate"); + + /** Static value AcceptableFluencyScorePerInstance for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = + fromString("AcceptableFluencyScorePerInstance"); + + /** Static value AggregatedFluencyPassRate for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric AGGREGATED_FLUENCY_PASS_RATE = + fromString("AggregatedFluencyPassRate"); + + /** Static value AcceptableSimilarityScorePerInstance for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = + fromString("AcceptableSimilarityScorePerInstance"); + + /** Static value AggregatedSimilarityPassRate for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric AGGREGATED_SIMILARITY_PASS_RATE = + fromString("AggregatedSimilarityPassRate"); + + /** Static value AcceptableRelevanceScorePerInstance for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = + fromString("AcceptableRelevanceScorePerInstance"); + + /** Static value AggregatedRelevancePassRate for GenerationSafetyQualityMetric. */ + public static final GenerationSafetyQualityMetric AGGREGATED_RELEVANCE_PASS_RATE = + fromString("AggregatedRelevancePassRate"); + + /** + * Creates a new instance of GenerationSafetyQualityMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GenerationSafetyQualityMetric() { + } + + /** + * Creates or finds a GenerationSafetyQualityMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding GenerationSafetyQualityMetric. + */ + @JsonCreator + public static GenerationSafetyQualityMetric fromString(String name) { + return fromString(name, GenerationSafetyQualityMetric.class); + } + + /** + * Gets known GenerationSafetyQualityMetric values. + * + * @return known GenerationSafetyQualityMetric values. + */ + public static Collection values() { + return values(GenerationSafetyQualityMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetricThreshold.java new file mode 100644 index 0000000000000..12171c0555754 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMetricThreshold.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Generation safety quality metric threshold definition. */ +@Fluent +public final class GenerationSafetyQualityMetricThreshold { + /* + * [Required] Gets or sets the feature attribution metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private GenerationSafetyQualityMetric metric; + + /* + * Gets or sets the threshold value. + * If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of GenerationSafetyQualityMetricThreshold class. */ + public GenerationSafetyQualityMetricThreshold() { + } + + /** + * Get the metric property: [Required] Gets or sets the feature attribution metric to calculate. + * + * @return the metric value. + */ + public GenerationSafetyQualityMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] Gets or sets the feature attribution metric to calculate. + * + * @param metric the metric value to set. + * @return the GenerationSafetyQualityMetricThreshold object itself. + */ + public GenerationSafetyQualityMetricThreshold withMetric(GenerationSafetyQualityMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: Gets or sets the threshold value. If null, a default value will be set depending on + * the selected metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: Gets or sets the threshold value. If null, a default value will be set depending on + * the selected metric. + * + * @param threshold the threshold value to set. + * @return the GenerationSafetyQualityMetricThreshold object itself. + */ + public GenerationSafetyQualityMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model GenerationSafetyQualityMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerationSafetyQualityMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMonitoringSignal.java new file mode 100644 index 0000000000000..809b59465b94b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationSafetyQualityMonitoringSignal.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Generation safety quality monitoring signal definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("GenerationSafetyQuality") +@Fluent +public final class GenerationSafetyQualityMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Gets or sets the metrics to calculate and the corresponding thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * Gets or sets the target data for computing metrics. + */ + @JsonProperty(value = "productionData") + private List productionData; + + /* + * [Required] The sample rate of the target data, should be greater than 0 and at most 1. + */ + @JsonProperty(value = "samplingRate", required = true) + private double samplingRate; + + /* + * Gets or sets the workspace connection ID used to connect to the content generation endpoint. + */ + @JsonProperty(value = "workspaceConnectionId") + private String workspaceConnectionId; + + /** Creates an instance of GenerationSafetyQualityMonitoringSignal class. */ + public GenerationSafetyQualityMonitoringSignal() { + } + + /** + * Get the metricThresholds property: [Required] Gets or sets the metrics to calculate and the corresponding + * thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] Gets or sets the metrics to calculate and the corresponding + * thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the GenerationSafetyQualityMonitoringSignal object itself. + */ + public GenerationSafetyQualityMonitoringSignal withMetricThresholds( + List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: Gets or sets the target data for computing metrics. + * + * @return the productionData value. + */ + public List productionData() { + return this.productionData; + } + + /** + * Set the productionData property: Gets or sets the target data for computing metrics. + * + * @param productionData the productionData value to set. + * @return the GenerationSafetyQualityMonitoringSignal object itself. + */ + public GenerationSafetyQualityMonitoringSignal withProductionData(List productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the samplingRate property: [Required] The sample rate of the target data, should be greater than 0 and at + * most 1. + * + * @return the samplingRate value. + */ + public double samplingRate() { + return this.samplingRate; + } + + /** + * Set the samplingRate property: [Required] The sample rate of the target data, should be greater than 0 and at + * most 1. + * + * @param samplingRate the samplingRate value to set. + * @return the GenerationSafetyQualityMonitoringSignal object itself. + */ + public GenerationSafetyQualityMonitoringSignal withSamplingRate(double samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Get the workspaceConnectionId property: Gets or sets the workspace connection ID used to connect to the content + * generation endpoint. + * + * @return the workspaceConnectionId value. + */ + public String workspaceConnectionId() { + return this.workspaceConnectionId; + } + + /** + * Set the workspaceConnectionId property: Gets or sets the workspace connection ID used to connect to the content + * generation endpoint. + * + * @param workspaceConnectionId the workspaceConnectionId value to set. + * @return the GenerationSafetyQualityMonitoringSignal object itself. + */ + public GenerationSafetyQualityMonitoringSignal withWorkspaceConnectionId(String workspaceConnectionId) { + this.workspaceConnectionId = workspaceConnectionId; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenerationSafetyQualityMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenerationSafetyQualityMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model GenerationSafetyQualityMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() != null) { + productionData().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerationSafetyQualityMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetric.java new file mode 100644 index 0000000000000..d54f0ac70a33e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetric.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Generation token statistics metric enum. */ +public final class GenerationTokenStatisticsMetric extends ExpandableStringEnum { + /** Static value TotalTokenCount for GenerationTokenStatisticsMetric. */ + public static final GenerationTokenStatisticsMetric TOTAL_TOKEN_COUNT = fromString("TotalTokenCount"); + + /** Static value TotalTokenCountPerGroup for GenerationTokenStatisticsMetric. */ + public static final GenerationTokenStatisticsMetric TOTAL_TOKEN_COUNT_PER_GROUP = + fromString("TotalTokenCountPerGroup"); + + /** + * Creates a new instance of GenerationTokenStatisticsMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GenerationTokenStatisticsMetric() { + } + + /** + * Creates or finds a GenerationTokenStatisticsMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding GenerationTokenStatisticsMetric. + */ + @JsonCreator + public static GenerationTokenStatisticsMetric fromString(String name) { + return fromString(name, GenerationTokenStatisticsMetric.class); + } + + /** + * Gets known GenerationTokenStatisticsMetric values. + * + * @return known GenerationTokenStatisticsMetric values. + */ + public static Collection values() { + return values(GenerationTokenStatisticsMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetricThreshold.java new file mode 100644 index 0000000000000..fcbbcb9e52014 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsMetricThreshold.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Generation token statistics metric threshold definition. */ +@Fluent +public final class GenerationTokenStatisticsMetricThreshold { + /* + * [Required] Gets or sets the feature attribution metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private GenerationTokenStatisticsMetric metric; + + /* + * Gets or sets the threshold value. + * If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of GenerationTokenStatisticsMetricThreshold class. */ + public GenerationTokenStatisticsMetricThreshold() { + } + + /** + * Get the metric property: [Required] Gets or sets the feature attribution metric to calculate. + * + * @return the metric value. + */ + public GenerationTokenStatisticsMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] Gets or sets the feature attribution metric to calculate. + * + * @param metric the metric value to set. + * @return the GenerationTokenStatisticsMetricThreshold object itself. + */ + public GenerationTokenStatisticsMetricThreshold withMetric(GenerationTokenStatisticsMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: Gets or sets the threshold value. If null, a default value will be set depending on + * the selected metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: Gets or sets the threshold value. If null, a default value will be set depending on + * the selected metric. + * + * @param threshold the threshold value to set. + * @return the GenerationTokenStatisticsMetricThreshold object itself. + */ + public GenerationTokenStatisticsMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model GenerationTokenStatisticsMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerationTokenStatisticsMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsSignal.java new file mode 100644 index 0000000000000..5be8ab2581207 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GenerationTokenStatisticsSignal.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Generation token statistics signal definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("GenerationTokenStatistics") +@Fluent +public final class GenerationTokenStatisticsSignal extends MonitoringSignalBase { + /* + * [Required] Gets or sets the metrics to calculate and the corresponding thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * Gets or sets the target data for computing metrics. + */ + @JsonProperty(value = "productionData") + private MonitoringInputDataBase productionData; + + /* + * [Required] The sample rate of the target data, should be greater than 0 and at most 1. + */ + @JsonProperty(value = "samplingRate", required = true) + private double samplingRate; + + /** Creates an instance of GenerationTokenStatisticsSignal class. */ + public GenerationTokenStatisticsSignal() { + } + + /** + * Get the metricThresholds property: [Required] Gets or sets the metrics to calculate and the corresponding + * thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] Gets or sets the metrics to calculate and the corresponding + * thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the GenerationTokenStatisticsSignal object itself. + */ + public GenerationTokenStatisticsSignal withMetricThresholds( + List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: Gets or sets the target data for computing metrics. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: Gets or sets the target data for computing metrics. + * + * @param productionData the productionData value to set. + * @return the GenerationTokenStatisticsSignal object itself. + */ + public GenerationTokenStatisticsSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the samplingRate property: [Required] The sample rate of the target data, should be greater than 0 and at + * most 1. + * + * @return the samplingRate value. + */ + public double samplingRate() { + return this.samplingRate; + } + + /** + * Set the samplingRate property: [Required] The sample rate of the target data, should be greater than 0 and at + * most 1. + * + * @param samplingRate the samplingRate value to set. + * @return the GenerationTokenStatisticsSignal object itself. + */ + public GenerationTokenStatisticsSignal withSamplingRate(double samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenerationTokenStatisticsSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenerationTokenStatisticsSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model GenerationTokenStatisticsSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() != null) { + productionData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerationTokenStatisticsSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HdfsDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HdfsDatastore.java new file mode 100644 index 0000000000000..e592d2f90f032 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HdfsDatastore.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** The HdfsDatastore model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") +@JsonTypeName("Hdfs") +@Fluent +public final class HdfsDatastore extends DatastoreProperties { + /* + * The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. + */ + @JsonProperty(value = "hdfsServerCertificate") + private String hdfsServerCertificate; + + /* + * [Required] IP Address or DNS HostName. + */ + @JsonProperty(value = "nameNodeAddress", required = true) + private String nameNodeAddress; + + /* + * Protocol used to communicate with the storage account (Https/Http). + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** Creates an instance of HdfsDatastore class. */ + public HdfsDatastore() { + } + + /** + * Get the hdfsServerCertificate property: The TLS cert of the HDFS server. Needs to be a base64 encoded string. + * Required if "Https" protocol is selected. + * + * @return the hdfsServerCertificate value. + */ + public String hdfsServerCertificate() { + return this.hdfsServerCertificate; + } + + /** + * Set the hdfsServerCertificate property: The TLS cert of the HDFS server. Needs to be a base64 encoded string. + * Required if "Https" protocol is selected. + * + * @param hdfsServerCertificate the hdfsServerCertificate value to set. + * @return the HdfsDatastore object itself. + */ + public HdfsDatastore withHdfsServerCertificate(String hdfsServerCertificate) { + this.hdfsServerCertificate = hdfsServerCertificate; + return this; + } + + /** + * Get the nameNodeAddress property: [Required] IP Address or DNS HostName. + * + * @return the nameNodeAddress value. + */ + public String nameNodeAddress() { + return this.nameNodeAddress; + } + + /** + * Set the nameNodeAddress property: [Required] IP Address or DNS HostName. + * + * @param nameNodeAddress the nameNodeAddress value to set. + * @return the HdfsDatastore object itself. + */ + public HdfsDatastore withNameNodeAddress(String nameNodeAddress) { + this.nameNodeAddress = nameNodeAddress; + return this; + } + + /** + * Get the protocol property: Protocol used to communicate with the storage account (Https/Http). + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol used to communicate with the storage account (Https/Http). + * + * @param protocol the protocol value to set. + * @return the HdfsDatastore object itself. + */ + public HdfsDatastore withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public HdfsDatastore withCredentials(DatastoreCredentials credentials) { + super.withCredentials(credentials); + return this; + } + + /** {@inheritDoc} */ + @Override + public HdfsDatastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public HdfsDatastore withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public HdfsDatastore withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public HdfsDatastore withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (nameNodeAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nameNodeAddress in model HdfsDatastore")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HdfsDatastore.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java index 9e86918bfd7af..dd71ac89715fb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Identity that will be used to access key vault for encryption at rest. */ +/** Identity object used for encryption. */ @Fluent public final class IdentityForCmk { /* - * The ArmId of the user assigned identity that will be used to access the customer managed key vault + * UserAssignedIdentity to be used to fetch the encryption key from keyVault */ @JsonProperty(value = "userAssignedIdentity") private String userAssignedIdentity; @@ -21,8 +21,7 @@ public IdentityForCmk() { } /** - * Get the userAssignedIdentity property: The ArmId of the user assigned identity that will be used to access the - * customer managed key vault. + * Get the userAssignedIdentity property: UserAssignedIdentity to be used to fetch the encryption key from keyVault. * * @return the userAssignedIdentity value. */ @@ -31,8 +30,7 @@ public String userAssignedIdentity() { } /** - * Set the userAssignedIdentity property: The ArmId of the user assigned identity that will be used to access the - * customer managed key vault. + * Set the userAssignedIdentity property: UserAssignedIdentity to be used to fetch the encryption key from keyVault. * * @param userAssignedIdentity the userAssignedIdentity value to set. * @return the IdentityForCmk object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdleShutdownSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdleShutdownSetting.java new file mode 100644 index 0000000000000..727e692d78dd3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdleShutdownSetting.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stops compute instance after user defined period of inactivity. */ +@Fluent +public final class IdleShutdownSetting { + /* + * Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + */ + @JsonProperty(value = "idleTimeBeforeShutdown") + private String idleTimeBeforeShutdown; + + /** Creates an instance of IdleShutdownSetting class. */ + public IdleShutdownSetting() { + } + + /** + * Get the idleTimeBeforeShutdown property: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + * + * @return the idleTimeBeforeShutdown value. + */ + public String idleTimeBeforeShutdown() { + return this.idleTimeBeforeShutdown; + } + + /** + * Set the idleTimeBeforeShutdown property: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + * + * @param idleTimeBeforeShutdown the idleTimeBeforeShutdown value to set. + * @return the IdleShutdownSetting object itself. + */ + public IdleShutdownSetting withIdleTimeBeforeShutdown(String idleTimeBeforeShutdown) { + this.idleTimeBeforeShutdown = idleTimeBeforeShutdown; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java new file mode 100644 index 0000000000000..011b1f441c1c7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** The Image model. */ +@Fluent +public final class Image { + /* + * Type of the image + * + * Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images + */ + @JsonProperty(value = "type") + private ImageType type; + + /* + * Image reference URL + */ + @JsonProperty(value = "reference") + private String reference; + + /* + * Dictionary of + */ + @JsonIgnore private Map additionalProperties; + + /** Creates an instance of Image class. */ + public Image() { + } + + /** + * Get the type property: Type of the image + * + *

Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + * + * @return the type value. + */ + public ImageType type() { + return this.type; + } + + /** + * Set the type property: Type of the image + * + *

Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + * + * @param type the type value to set. + * @return the Image object itself. + */ + public Image withType(ImageType type) { + this.type = type; + return this; + } + + /** + * Get the reference property: Image reference URL. + * + * @return the reference value. + */ + public String reference() { + return this.reference; + } + + /** + * Set the reference property: Image reference URL. + * + * @param reference the reference value to set. + * @return the Image object itself. + */ + public Image withReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Get the additionalProperties property: Dictionary of <any>. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Dictionary of <any>. + * + * @param additionalProperties the additionalProperties value to set. + * @return the Image object itself. + */ + public Image withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageAnnotationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageAnnotationType.java new file mode 100644 index 0000000000000..7b072fe094ea1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageAnnotationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Annotation type of image data. */ +public final class ImageAnnotationType extends ExpandableStringEnum { + /** Static value Classification for ImageAnnotationType. */ + public static final ImageAnnotationType CLASSIFICATION = fromString("Classification"); + + /** Static value BoundingBox for ImageAnnotationType. */ + public static final ImageAnnotationType BOUNDING_BOX = fromString("BoundingBox"); + + /** Static value InstanceSegmentation for ImageAnnotationType. */ + public static final ImageAnnotationType INSTANCE_SEGMENTATION = fromString("InstanceSegmentation"); + + /** + * Creates a new instance of ImageAnnotationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageAnnotationType() { + } + + /** + * Creates or finds a ImageAnnotationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageAnnotationType. + */ + @JsonCreator + public static ImageAnnotationType fromString(String name) { + return fromString(name, ImageAnnotationType.class); + } + + /** + * Gets known ImageAnnotationType values. + * + * @return known ImageAnnotationType values. + */ + public static Collection values() { + return values(ImageAnnotationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java new file mode 100644 index 0000000000000..7cbaecab774c7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Returns metadata about the operating system image for this compute instance. */ +@Fluent +public final class ImageMetadata { + /* + * Specifies the current operating system image version this compute instance is running on. + */ + @JsonProperty(value = "currentImageVersion") + private String currentImageVersion; + + /* + * Specifies the latest available operating system image version. + */ + @JsonProperty(value = "latestImageVersion") + private String latestImageVersion; + + /* + * Specifies whether this compute instance is running on the latest operating system image. + */ + @JsonProperty(value = "isLatestOsImageVersion") + private Boolean isLatestOsImageVersion; + + /* + * Metadata about the os patching. + */ + @JsonProperty(value = "osPatchingStatus", access = JsonProperty.Access.WRITE_ONLY) + private OsPatchingStatus osPatchingStatus; + + /** Creates an instance of ImageMetadata class. */ + public ImageMetadata() { + } + + /** + * Get the currentImageVersion property: Specifies the current operating system image version this compute instance + * is running on. + * + * @return the currentImageVersion value. + */ + public String currentImageVersion() { + return this.currentImageVersion; + } + + /** + * Set the currentImageVersion property: Specifies the current operating system image version this compute instance + * is running on. + * + * @param currentImageVersion the currentImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withCurrentImageVersion(String currentImageVersion) { + this.currentImageVersion = currentImageVersion; + return this; + } + + /** + * Get the latestImageVersion property: Specifies the latest available operating system image version. + * + * @return the latestImageVersion value. + */ + public String latestImageVersion() { + return this.latestImageVersion; + } + + /** + * Set the latestImageVersion property: Specifies the latest available operating system image version. + * + * @param latestImageVersion the latestImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withLatestImageVersion(String latestImageVersion) { + this.latestImageVersion = latestImageVersion; + return this; + } + + /** + * Get the isLatestOsImageVersion property: Specifies whether this compute instance is running on the latest + * operating system image. + * + * @return the isLatestOsImageVersion value. + */ + public Boolean isLatestOsImageVersion() { + return this.isLatestOsImageVersion; + } + + /** + * Set the isLatestOsImageVersion property: Specifies whether this compute instance is running on the latest + * operating system image. + * + * @param isLatestOsImageVersion the isLatestOsImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withIsLatestOsImageVersion(Boolean isLatestOsImageVersion) { + this.isLatestOsImageVersion = isLatestOsImageVersion; + return this; + } + + /** + * Get the osPatchingStatus property: Metadata about the os patching. + * + * @return the osPatchingStatus value. + */ + public OsPatchingStatus osPatchingStatus() { + return this.osPatchingStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osPatchingStatus() != null) { + osPatchingStatus().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java index 968ea07751a86..cd620256dc849 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> All distributions can be specified as distribution_name(min, max) or choice(val1, - * val2, ..., valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to - * compose distribution expressions please check the documentation: + * Distribution expressions to sweep over values of model settings. <example> Some examples are: ``` ModelName = + * "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, 2)"; + * ```</example> All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., + * valn) where distribution name can be: uniform, quniform, loguniform, etc For more details on how to compose + * distribution expressions please check the documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters For more information on the * available settings please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java index 5615072d44375..2deffd4fbea09 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> For more details on how to compose distribution expressions please check the - * documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters For more - * information on the available settings please visit the official documentation: + * Distribution expressions to sweep over values of model settings. <example> Some examples are: ``` ModelName = + * "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, 2)"; + * ```</example> For more details on how to compose distribution expressions please check the documentation: + * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters For more information on the + * available settings please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ @Fluent diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java index 20c36d838c766..b681b502dbfbf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> For more details on how to compose distribution expressions please check the - * documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters For more - * information on the available settings please visit the official documentation: + * Distribution expressions to sweep over values of model settings. <example> Some examples are: ``` ModelName = + * "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, 2)"; + * ```</example> For more details on how to compose distribution expressions please check the documentation: + * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters For more information on the + * available settings please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ @Fluent diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java index aa171c49914da..769518f3bef4d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java @@ -35,6 +35,18 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings @JsonProperty(value = "imageSize") private Integer imageSize; + /* + * Enable computing and logging training metrics. + */ + @JsonProperty(value = "logTrainingMetrics") + private LogTrainingMetrics logTrainingMetrics; + + /* + * Enable computing and logging validation loss. + */ + @JsonProperty(value = "logValidationLoss") + private LogValidationLoss logValidationLoss; + /* * Maximum size of the image to be rescaled before feeding it to the backbone. * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. @@ -180,6 +192,46 @@ public ImageModelSettingsObjectDetection withImageSize(Integer imageSize) { return this; } + /** + * Get the logTrainingMetrics property: Enable computing and logging training metrics. + * + * @return the logTrainingMetrics value. + */ + public LogTrainingMetrics logTrainingMetrics() { + return this.logTrainingMetrics; + } + + /** + * Set the logTrainingMetrics property: Enable computing and logging training metrics. + * + * @param logTrainingMetrics the logTrainingMetrics value to set. + * @return the ImageModelSettingsObjectDetection object itself. + */ + public ImageModelSettingsObjectDetection withLogTrainingMetrics(LogTrainingMetrics logTrainingMetrics) { + this.logTrainingMetrics = logTrainingMetrics; + return this; + } + + /** + * Get the logValidationLoss property: Enable computing and logging validation loss. + * + * @return the logValidationLoss value. + */ + public LogValidationLoss logValidationLoss() { + return this.logValidationLoss; + } + + /** + * Set the logValidationLoss property: Enable computing and logging validation loss. + * + * @param logValidationLoss the logValidationLoss value to set. + * @return the ImageModelSettingsObjectDetection object itself. + */ + public ImageModelSettingsObjectDetection withLogValidationLoss(LogValidationLoss logValidationLoss) { + this.logValidationLoss = logValidationLoss; + return this; + } + /** * Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. Must be a * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java new file mode 100644 index 0000000000000..06f62fc11ed0c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of the image + * + *

Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + */ +public final class ImageType extends ExpandableStringEnum { + /** Static value docker for ImageType. */ + public static final ImageType DOCKER = fromString("docker"); + + /** Static value azureml for ImageType. */ + public static final ImageType AZUREML = fromString("azureml"); + + /** + * Creates a new instance of ImageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageType() { + } + + /** + * Creates or finds a ImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageType. + */ + @JsonCreator + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** + * Gets known ImageType values. + * + * @return known ImageType values. + */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImportDataAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImportDataAction.java new file mode 100644 index 0000000000000..daa8e6bd48989 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImportDataAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The ImportDataAction model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +@JsonTypeName("ImportData") +@Fluent +public final class ImportDataAction extends ScheduleActionBase { + /* + * [Required] Defines Schedule action definition details. + */ + @JsonProperty(value = "dataImportDefinition", required = true) + private DataImport dataImportDefinition; + + /** Creates an instance of ImportDataAction class. */ + public ImportDataAction() { + } + + /** + * Get the dataImportDefinition property: [Required] Defines Schedule action definition details. + * + * @return the dataImportDefinition value. + */ + public DataImport dataImportDefinition() { + return this.dataImportDefinition; + } + + /** + * Set the dataImportDefinition property: [Required] Defines Schedule action definition details. + * + * @param dataImportDefinition the dataImportDefinition value to set. + * @return the ImportDataAction object itself. + */ + public ImportDataAction withDataImportDefinition(DataImport dataImportDefinition) { + this.dataImportDefinition = dataImportDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataImportDefinition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataImportDefinition in model ImportDataAction")); + } else { + dataImportDefinition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportDataAction.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IncrementalDataRefresh.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IncrementalDataRefresh.java new file mode 100644 index 0000000000000..d4c16dec802b4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IncrementalDataRefresh.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether IncrementalDataRefresh is enabled. */ +public final class IncrementalDataRefresh extends ExpandableStringEnum { + /** Static value Enabled for IncrementalDataRefresh. */ + public static final IncrementalDataRefresh ENABLED = fromString("Enabled"); + + /** Static value Disabled for IncrementalDataRefresh. */ + public static final IncrementalDataRefresh DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of IncrementalDataRefresh value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncrementalDataRefresh() { + } + + /** + * Creates or finds a IncrementalDataRefresh from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncrementalDataRefresh. + */ + @JsonCreator + public static IncrementalDataRefresh fromString(String name) { + return fromString(name, IncrementalDataRefresh.class); + } + + /** + * Gets known IncrementalDataRefresh values. + * + * @return known IncrementalDataRefresh values. + */ + public static Collection values() { + return values(IncrementalDataRefresh.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java new file mode 100644 index 0000000000000..3200a4f62429b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dto object representing index column. */ +@Fluent +public final class IndexColumn { + /* + * Specifies the column name + */ + @JsonProperty(value = "columnName") + private String columnName; + + /* + * Specifies the data type + */ + @JsonProperty(value = "dataType") + private FeatureDataType dataType; + + /** Creates an instance of IndexColumn class. */ + public IndexColumn() { + } + + /** + * Get the columnName property: Specifies the column name. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName property: Specifies the column name. + * + * @param columnName the columnName value to set. + * @return the IndexColumn object itself. + */ + public IndexColumn withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Get the dataType property: Specifies the data type. + * + * @return the dataType value. + */ + public FeatureDataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Specifies the data type. + * + * @param dataType the dataType value to set. + * @return the IndexColumn object itself. + */ + public IndexColumn withDataType(FeatureDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServer.java new file mode 100644 index 0000000000000..d95092f2d6ce3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServer.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The InferencingServer model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "serverType", + defaultImpl = InferencingServer.class) +@JsonTypeName("InferencingServer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureMLBatch", value = AzureMLBatchInferencingServer.class), + @JsonSubTypes.Type(name = "AzureMLOnline", value = AzureMLOnlineInferencingServer.class), + @JsonSubTypes.Type(name = "Custom", value = CustomInferencingServer.class), + @JsonSubTypes.Type(name = "Triton", value = TritonInferencingServer.class) +}) +@Immutable +public class InferencingServer { + /** Creates an instance of InferencingServer class. */ + public InferencingServer() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServerType.java new file mode 100644 index 0000000000000..112d9c1bccc5b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferencingServerType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Inferencing server type for various targets. */ +public final class InferencingServerType extends ExpandableStringEnum { + /** Static value AzureMLOnline for InferencingServerType. */ + public static final InferencingServerType AZURE_MLONLINE = fromString("AzureMLOnline"); + + /** Static value AzureMLBatch for InferencingServerType. */ + public static final InferencingServerType AZURE_MLBATCH = fromString("AzureMLBatch"); + + /** Static value Triton for InferencingServerType. */ + public static final InferencingServerType TRITON = fromString("Triton"); + + /** Static value Custom for InferencingServerType. */ + public static final InferencingServerType CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of InferencingServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InferencingServerType() { + } + + /** + * Creates or finds a InferencingServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InferencingServerType. + */ + @JsonCreator + public static InferencingServerType fromString(String name) { + return fromString(name, InferencingServerType.class); + } + + /** + * Gets known InferencingServerType values. + * + * @return known InferencingServerType values. + */ + public static Collection values() { + return values(InferencingServerType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputPathType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputPathType.java new file mode 100644 index 0000000000000..57f4b1717f1e5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputPathType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Input path type for package inputs. */ +public final class InputPathType extends ExpandableStringEnum { + /** Static value Url for InputPathType. */ + public static final InputPathType URL = fromString("Url"); + + /** Static value PathId for InputPathType. */ + public static final InputPathType PATH_ID = fromString("PathId"); + + /** Static value PathVersion for InputPathType. */ + public static final InputPathType PATH_VERSION = fromString("PathVersion"); + + /** + * Creates a new instance of InputPathType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InputPathType() { + } + + /** + * Creates or finds a InputPathType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InputPathType. + */ + @JsonCreator + public static InputPathType fromString(String name) { + return fromString(name, InputPathType.class); + } + + /** + * Gets known InputPathType values. + * + * @return known InputPathType values. + */ + public static Collection values() { + return values(InputPathType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IntellectualProperty.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IntellectualProperty.java new file mode 100644 index 0000000000000..6c776a6d7e679 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IntellectualProperty.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Intellectual Property details for a resource. */ +@Fluent +public final class IntellectualProperty { + /* + * Protection level of the Intellectual Property. + */ + @JsonProperty(value = "protectionLevel") + private ProtectionLevel protectionLevel; + + /* + * [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /** Creates an instance of IntellectualProperty class. */ + public IntellectualProperty() { + } + + /** + * Get the protectionLevel property: Protection level of the Intellectual Property. + * + * @return the protectionLevel value. + */ + public ProtectionLevel protectionLevel() { + return this.protectionLevel; + } + + /** + * Set the protectionLevel property: Protection level of the Intellectual Property. + * + * @param protectionLevel the protectionLevel value to set. + * @return the IntellectualProperty object itself. + */ + public IntellectualProperty withProtectionLevel(ProtectionLevel protectionLevel) { + this.protectionLevel = protectionLevel; + return this; + } + + /** + * Get the publisher property: [Required] Publisher of the Intellectual Property. Must be the same as Registry + * publisher name. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: [Required] Publisher of the Intellectual Property. Must be the same as Registry + * publisher name. + * + * @param publisher the publisher value to set. + * @return the IntellectualProperty object itself. + */ + public IntellectualProperty withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisher() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property publisher in model IntellectualProperty")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IntellectualProperty.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java new file mode 100644 index 0000000000000..2c23feede93aa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Isolation mode for the managed network of a machine learning workspace. */ +public final class IsolationMode extends ExpandableStringEnum { + /** Static value Disabled for IsolationMode. */ + public static final IsolationMode DISABLED = fromString("Disabled"); + + /** Static value AllowInternetOutbound for IsolationMode. */ + public static final IsolationMode ALLOW_INTERNET_OUTBOUND = fromString("AllowInternetOutbound"); + + /** Static value AllowOnlyApprovedOutbound for IsolationMode. */ + public static final IsolationMode ALLOW_ONLY_APPROVED_OUTBOUND = fromString("AllowOnlyApprovedOutbound"); + + /** + * Creates a new instance of IsolationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsolationMode() { + } + + /** + * Creates or finds a IsolationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsolationMode. + */ + @JsonCreator + public static IsolationMode fromString(String name) { + return fromString(name, IsolationMode.class); + } + + /** + * Gets known IsolationMode values. + * + * @return known IsolationMode values. + */ + public static Collection values() { + return values(IsolationMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java index 3e18abd293bd0..5da669d59d4b9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java @@ -66,11 +66,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The JobBase definition stages. */ interface DefinitionStages { /** The first stage of the JobBase definition. */ interface Blank extends WithParentResource { } + /** The stage of the JobBase definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -82,6 +84,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the JobBase definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(JobBaseProperties properties); } + /** * The stage of the JobBase definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { JobBase create(Context context); } } + /** * Begins update for the JobBase resource. * @@ -137,19 +142,21 @@ interface Update extends UpdateStages.WithProperties { */ JobBase apply(Context context); } + /** The JobBase update stages. */ interface UpdateStages { /** The stage of the JobBase update allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: [Required] Additional attributes of the entity.. + * Specifies the properties property: Additional attributes of the entity.. * - * @param properties [Required] Additional attributes of the entity. + * @param properties Additional attributes of the entity. * @return the next definition stage. */ - Update withProperties(JobBaseProperties properties); + Update withProperties(PartialJobBase properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java index 8a72ed8f844bc..e2fe1f7d889a9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java @@ -20,9 +20,11 @@ defaultImpl = JobBaseProperties.class) @JsonTypeName("JobBaseProperties") @JsonSubTypes({ + @JsonSubTypes.Type(name = "Labeling", value = LabelingJobProperties.class), @JsonSubTypes.Type(name = "AutoML", value = AutoMLJob.class), @JsonSubTypes.Type(name = "Command", value = CommandJob.class), @JsonSubTypes.Type(name = "Pipeline", value = PipelineJob.class), + @JsonSubTypes.Type(name = "Spark", value = SparkJob.class), @JsonSubTypes.Type(name = "Sweep", value = SweepJob.class) }) @Fluent @@ -64,6 +66,19 @@ public class JobBaseProperties extends ResourceBase { @JsonProperty(value = "isArchived") private Boolean isArchived; + /* + * Notification setting for the job + */ + @JsonProperty(value = "notificationSetting") + private NotificationSetting notificationSetting; + + /* + * Configuration for secrets to be made available during runtime. + */ + @JsonProperty(value = "secretsConfiguration") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secretsConfiguration; + /* * List of JobEndpoints. * For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -206,6 +221,46 @@ public JobBaseProperties withIsArchived(Boolean isArchived) { return this; } + /** + * Get the notificationSetting property: Notification setting for the job. + * + * @return the notificationSetting value. + */ + public NotificationSetting notificationSetting() { + return this.notificationSetting; + } + + /** + * Set the notificationSetting property: Notification setting for the job. + * + * @param notificationSetting the notificationSetting value to set. + * @return the JobBaseProperties object itself. + */ + public JobBaseProperties withNotificationSetting(NotificationSetting notificationSetting) { + this.notificationSetting = notificationSetting; + return this; + } + + /** + * Get the secretsConfiguration property: Configuration for secrets to be made available during runtime. + * + * @return the secretsConfiguration value. + */ + public Map secretsConfiguration() { + return this.secretsConfiguration; + } + + /** + * Set the secretsConfiguration property: Configuration for secrets to be made available during runtime. + * + * @param secretsConfiguration the secretsConfiguration value to set. + * @return the JobBaseProperties object itself. + */ + public JobBaseProperties withSecretsConfiguration(Map secretsConfiguration) { + this.secretsConfiguration = secretsConfiguration; + return this; + } + /** * Get the services property: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of * FileStreamObject. @@ -269,6 +324,19 @@ public void validate() { if (identity() != null) { identity().validate(); } + if (notificationSetting() != null) { + notificationSetting().validate(); + } + if (secretsConfiguration() != null) { + secretsConfiguration() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } if (services() != null) { services() .values() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobProvisioningState.java new file mode 100644 index 0000000000000..753adb931dc65 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the job provisioning state. */ +public final class JobProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for JobProvisioningState. */ + public static final JobProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for JobProvisioningState. */ + public static final JobProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for JobProvisioningState. */ + public static final JobProvisioningState CANCELED = fromString("Canceled"); + + /** Static value InProgress for JobProvisioningState. */ + public static final JobProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of JobProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobProvisioningState() { + } + + /** + * Creates or finds a JobProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobProvisioningState. + */ + @JsonCreator + public static JobProvisioningState fromString(String name) { + return fromString(name, JobProvisioningState.class); + } + + /** + * Gets known JobProvisioningState values. + * + * @return known JobProvisioningState values. + */ + public static Collection values() { + return values(JobProvisioningState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java index 37e80aca4c90c..a81bab70984f4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** The JobResourceConfiguration model. */ @@ -91,6 +92,20 @@ public JobResourceConfiguration withInstanceType(String instanceType) { return this; } + /** {@inheritDoc} */ + @Override + public JobResourceConfiguration withLocations(List locations) { + super.withLocations(locations); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceConfiguration withMaxInstanceCount(Integer maxInstanceCount) { + super.withMaxInstanceCount(maxInstanceCount); + return this; + } + /** {@inheritDoc} */ @Override public JobResourceConfiguration withProperties(Map properties) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java index a581c73835ad3..67a37a625a0d5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java @@ -31,7 +31,14 @@ public final class JobService { private String jobServiceType; /* - * Port for endpoint. + * Nodes that user would like to start the service on. + * If Nodes is not set or set to null, the service will only be started on leader node. + */ + @JsonProperty(value = "nodes") + private Nodes nodes; + + /* + * Port for endpoint set by user. */ @JsonProperty(value = "port") private Integer port; @@ -103,7 +110,29 @@ public JobService withJobServiceType(String jobServiceType) { } /** - * Get the port property: Port for endpoint. + * Get the nodes property: Nodes that user would like to start the service on. If Nodes is not set or set to null, + * the service will only be started on leader node. + * + * @return the nodes value. + */ + public Nodes nodes() { + return this.nodes; + } + + /** + * Set the nodes property: Nodes that user would like to start the service on. If Nodes is not set or set to null, + * the service will only be started on leader node. + * + * @param nodes the nodes value to set. + * @return the JobService object itself. + */ + public JobService withNodes(Nodes nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get the port property: Port for endpoint set by user. * * @return the port value. */ @@ -112,7 +141,7 @@ public Integer port() { } /** - * Set the port property: Port for endpoint. + * Set the port property: Port for endpoint set by user. * * @param port the port value to set. * @return the JobService object itself. @@ -157,5 +186,8 @@ public String status() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (nodes() != null) { + nodes().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java index 009ec1b6995b5..b275af521b026 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java @@ -52,6 +52,9 @@ public final class JobStatus extends ExpandableStringEnum { /** Static value Unknown for JobStatus. */ public static final JobStatus UNKNOWN = fromString("Unknown"); + /** Static value Scheduled for JobStatus. */ + public static final JobStatus SCHEDULED = fromString("Scheduled"); + /** * Creates a new instance of JobStatus value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java new file mode 100644 index 0000000000000..c5910ee4250b9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the job tier. */ +public final class JobTier extends ExpandableStringEnum { + /** Static value Null for JobTier. */ + public static final JobTier NULL = fromString("Null"); + + /** Static value Spot for JobTier. */ + public static final JobTier SPOT = fromString("Spot"); + + /** Static value Basic for JobTier. */ + public static final JobTier BASIC = fromString("Basic"); + + /** Static value Standard for JobTier. */ + public static final JobTier STANDARD = fromString("Standard"); + + /** Static value Premium for JobTier. */ + public static final JobTier PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of JobTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobTier() { + } + + /** + * Creates or finds a JobTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobTier. + */ + @JsonCreator + public static JobTier fromString(String name) { + return fromString(name, JobTier.class); + } + + /** + * Gets known JobTier values. + * + * @return known JobTier values. + */ + public static Collection values() { + return values(JobTier.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java index 681eb7abb0448..dceed68725cf1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java @@ -16,12 +16,18 @@ public final class JobType extends ExpandableStringEnum { /** Static value Command for JobType. */ public static final JobType COMMAND = fromString("Command"); + /** Static value Labeling for JobType. */ + public static final JobType LABELING = fromString("Labeling"); + /** Static value Sweep for JobType. */ public static final JobType SWEEP = fromString("Sweep"); /** Static value Pipeline for JobType. */ public static final JobType PIPELINE = fromString("Pipeline"); + /** Static value Spark for JobType. */ + public static final JobType SPARK = fromString("Spark"); + /** * Creates a new instance of JobType value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java index cba708d43905e..c80f40aea3042 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java @@ -31,6 +31,9 @@ public interface Jobs { * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param assetName Asset name the job's named output is registered with. + * @param scheduled Indicator whether the job is scheduled job. + * @param scheduleId The scheduled id for listing the job triggered from. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -44,6 +47,9 @@ PagedIterable list( String jobType, String tag, ListViewType listViewType, + String assetName, + Boolean scheduled, + String scheduleId, Context context); /** diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosCredentials.java new file mode 100644 index 0000000000000..869b90847ba75 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosCredentials.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The KerberosCredentials model. */ +@Fluent +public class KerberosCredentials { + /* + * [Required] IP Address or DNS HostName. + */ + @JsonProperty(value = "kerberosKdcAddress", required = true) + private String kerberosKdcAddress; + + /* + * [Required] Kerberos Username + */ + @JsonProperty(value = "kerberosPrincipal", required = true) + private String kerberosPrincipal; + + /* + * [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or + * service. + */ + @JsonProperty(value = "kerberosRealm", required = true) + private String kerberosRealm; + + /** Creates an instance of KerberosCredentials class. */ + public KerberosCredentials() { + } + + /** + * Get the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @return the kerberosKdcAddress value. + */ + public String kerberosKdcAddress() { + return this.kerberosKdcAddress; + } + + /** + * Set the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @param kerberosKdcAddress the kerberosKdcAddress value to set. + * @return the KerberosCredentials object itself. + */ + public KerberosCredentials withKerberosKdcAddress(String kerberosKdcAddress) { + this.kerberosKdcAddress = kerberosKdcAddress; + return this; + } + + /** + * Get the kerberosPrincipal property: [Required] Kerberos Username. + * + * @return the kerberosPrincipal value. + */ + public String kerberosPrincipal() { + return this.kerberosPrincipal; + } + + /** + * Set the kerberosPrincipal property: [Required] Kerberos Username. + * + * @param kerberosPrincipal the kerberosPrincipal value to set. + * @return the KerberosCredentials object itself. + */ + public KerberosCredentials withKerberosPrincipal(String kerberosPrincipal) { + this.kerberosPrincipal = kerberosPrincipal; + return this; + } + + /** + * Get the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @return the kerberosRealm value. + */ + public String kerberosRealm() { + return this.kerberosRealm; + } + + /** + * Set the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @param kerberosRealm the kerberosRealm value to set. + * @return the KerberosCredentials object itself. + */ + public KerberosCredentials withKerberosRealm(String kerberosRealm) { + this.kerberosRealm = kerberosRealm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kerberosKdcAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosKdcAddress in model KerberosCredentials")); + } + if (kerberosPrincipal() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosPrincipal in model KerberosCredentials")); + } + if (kerberosRealm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosRealm in model KerberosCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KerberosCredentials.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabCredentials.java new file mode 100644 index 0000000000000..c768b9883eb27 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabCredentials.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The KerberosKeytabCredentials model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") +@JsonTypeName("KerberosKeytab") +@Fluent +public final class KerberosKeytabCredentials extends DatastoreCredentials { + /* + * [Required] Keytab secrets. + */ + @JsonProperty(value = "secrets") + private KerberosKeytabSecrets secrets; + + /* + * [Required] IP Address or DNS HostName. + */ + @JsonProperty(value = "kerberosKdcAddress", required = true) + private String kerberosKdcAddress; + + /* + * [Required] Kerberos Username + */ + @JsonProperty(value = "kerberosPrincipal", required = true) + private String kerberosPrincipal; + + /* + * [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or + * service. + */ + @JsonProperty(value = "kerberosRealm", required = true) + private String kerberosRealm; + + /** Creates an instance of KerberosKeytabCredentials class. */ + public KerberosKeytabCredentials() { + } + + /** + * Get the secrets property: [Required] Keytab secrets. + * + * @return the secrets value. + */ + public KerberosKeytabSecrets secrets() { + return this.secrets; + } + + /** + * Set the secrets property: [Required] Keytab secrets. + * + * @param secrets the secrets value to set. + * @return the KerberosKeytabCredentials object itself. + */ + public KerberosKeytabCredentials withSecrets(KerberosKeytabSecrets secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @return the kerberosKdcAddress value. + */ + public String kerberosKdcAddress() { + return this.kerberosKdcAddress; + } + + /** + * Set the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @param kerberosKdcAddress the kerberosKdcAddress value to set. + * @return the KerberosKeytabCredentials object itself. + */ + public KerberosKeytabCredentials withKerberosKdcAddress(String kerberosKdcAddress) { + this.kerberosKdcAddress = kerberosKdcAddress; + return this; + } + + /** + * Get the kerberosPrincipal property: [Required] Kerberos Username. + * + * @return the kerberosPrincipal value. + */ + public String kerberosPrincipal() { + return this.kerberosPrincipal; + } + + /** + * Set the kerberosPrincipal property: [Required] Kerberos Username. + * + * @param kerberosPrincipal the kerberosPrincipal value to set. + * @return the KerberosKeytabCredentials object itself. + */ + public KerberosKeytabCredentials withKerberosPrincipal(String kerberosPrincipal) { + this.kerberosPrincipal = kerberosPrincipal; + return this; + } + + /** + * Get the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @return the kerberosRealm value. + */ + public String kerberosRealm() { + return this.kerberosRealm; + } + + /** + * Set the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @param kerberosRealm the kerberosRealm value to set. + * @return the KerberosKeytabCredentials object itself. + */ + public KerberosKeytabCredentials withKerberosRealm(String kerberosRealm) { + this.kerberosRealm = kerberosRealm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (secrets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secrets in model KerberosKeytabCredentials")); + } else { + secrets().validate(); + } + if (kerberosKdcAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosKdcAddress in model KerberosKeytabCredentials")); + } + if (kerberosPrincipal() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosPrincipal in model KerberosKeytabCredentials")); + } + if (kerberosRealm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosRealm in model KerberosKeytabCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KerberosKeytabCredentials.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabSecrets.java new file mode 100644 index 0000000000000..64fa0dd354450 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosKeytabSecrets.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The KerberosKeytabSecrets model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") +@JsonTypeName("KerberosKeytab") +@Fluent +public final class KerberosKeytabSecrets extends DatastoreSecretsInner { + /* + * Kerberos keytab secret. + */ + @JsonProperty(value = "kerberosKeytab") + private String kerberosKeytab; + + /** Creates an instance of KerberosKeytabSecrets class. */ + public KerberosKeytabSecrets() { + } + + /** + * Get the kerberosKeytab property: Kerberos keytab secret. + * + * @return the kerberosKeytab value. + */ + public String kerberosKeytab() { + return this.kerberosKeytab; + } + + /** + * Set the kerberosKeytab property: Kerberos keytab secret. + * + * @param kerberosKeytab the kerberosKeytab value to set. + * @return the KerberosKeytabSecrets object itself. + */ + public KerberosKeytabSecrets withKerberosKeytab(String kerberosKeytab) { + this.kerberosKeytab = kerberosKeytab; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordCredentials.java new file mode 100644 index 0000000000000..4fe885c241cde --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordCredentials.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The KerberosPasswordCredentials model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") +@JsonTypeName("KerberosPassword") +@Fluent +public final class KerberosPasswordCredentials extends DatastoreCredentials { + /* + * [Required] Kerberos password secrets. + */ + @JsonProperty(value = "secrets") + private KerberosPasswordSecrets secrets; + + /* + * [Required] IP Address or DNS HostName. + */ + @JsonProperty(value = "kerberosKdcAddress", required = true) + private String kerberosKdcAddress; + + /* + * [Required] Kerberos Username + */ + @JsonProperty(value = "kerberosPrincipal", required = true) + private String kerberosPrincipal; + + /* + * [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or + * service. + */ + @JsonProperty(value = "kerberosRealm", required = true) + private String kerberosRealm; + + /** Creates an instance of KerberosPasswordCredentials class. */ + public KerberosPasswordCredentials() { + } + + /** + * Get the secrets property: [Required] Kerberos password secrets. + * + * @return the secrets value. + */ + public KerberosPasswordSecrets secrets() { + return this.secrets; + } + + /** + * Set the secrets property: [Required] Kerberos password secrets. + * + * @param secrets the secrets value to set. + * @return the KerberosPasswordCredentials object itself. + */ + public KerberosPasswordCredentials withSecrets(KerberosPasswordSecrets secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @return the kerberosKdcAddress value. + */ + public String kerberosKdcAddress() { + return this.kerberosKdcAddress; + } + + /** + * Set the kerberosKdcAddress property: [Required] IP Address or DNS HostName. + * + * @param kerberosKdcAddress the kerberosKdcAddress value to set. + * @return the KerberosPasswordCredentials object itself. + */ + public KerberosPasswordCredentials withKerberosKdcAddress(String kerberosKdcAddress) { + this.kerberosKdcAddress = kerberosKdcAddress; + return this; + } + + /** + * Get the kerberosPrincipal property: [Required] Kerberos Username. + * + * @return the kerberosPrincipal value. + */ + public String kerberosPrincipal() { + return this.kerberosPrincipal; + } + + /** + * Set the kerberosPrincipal property: [Required] Kerberos Username. + * + * @param kerberosPrincipal the kerberosPrincipal value to set. + * @return the KerberosPasswordCredentials object itself. + */ + public KerberosPasswordCredentials withKerberosPrincipal(String kerberosPrincipal) { + this.kerberosPrincipal = kerberosPrincipal; + return this; + } + + /** + * Get the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @return the kerberosRealm value. + */ + public String kerberosRealm() { + return this.kerberosRealm; + } + + /** + * Set the kerberosRealm property: [Required] Domain over which a Kerberos authentication server has the authority + * to authenticate a user, host or service. + * + * @param kerberosRealm the kerberosRealm value to set. + * @return the KerberosPasswordCredentials object itself. + */ + public KerberosPasswordCredentials withKerberosRealm(String kerberosRealm) { + this.kerberosRealm = kerberosRealm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (secrets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secrets in model KerberosPasswordCredentials")); + } else { + secrets().validate(); + } + if (kerberosKdcAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosKdcAddress in model KerberosPasswordCredentials")); + } + if (kerberosPrincipal() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosPrincipal in model KerberosPasswordCredentials")); + } + if (kerberosRealm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kerberosRealm in model KerberosPasswordCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KerberosPasswordCredentials.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordSecrets.java new file mode 100644 index 0000000000000..47c790ad259eb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KerberosPasswordSecrets.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The KerberosPasswordSecrets model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") +@JsonTypeName("KerberosPassword") +@Fluent +public final class KerberosPasswordSecrets extends DatastoreSecretsInner { + /* + * Kerberos password secret. + */ + @JsonProperty(value = "kerberosPassword") + private String kerberosPassword; + + /** Creates an instance of KerberosPasswordSecrets class. */ + public KerberosPasswordSecrets() { + } + + /** + * Get the kerberosPassword property: Kerberos password secret. + * + * @return the kerberosPassword value. + */ + public String kerberosPassword() { + return this.kerberosPassword; + } + + /** + * Set the kerberosPassword property: Kerberos password secret. + * + * @param kerberosPassword the kerberosPassword value to set. + * @return the KerberosPasswordSecrets object itself. + */ + public KerberosPasswordSecrets withKerberosPassword(String kerberosPassword) { + this.kerberosPassword = kerberosPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyVaultProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..8cd9f0954093d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyVaultProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer Key vault properties. */ +@Fluent +public final class KeyVaultProperties { + /* + * Currently, we support only SystemAssigned MSI. + * We need this when we support UserAssignedIdentities + */ + @JsonProperty(value = "identityClientId") + private String identityClientId; + + /* + * KeyVault key identifier to encrypt the data + */ + @JsonProperty(value = "keyIdentifier", required = true) + private String keyIdentifier; + + /* + * KeyVault Arm Id that contains the data encryption key + */ + @JsonProperty(value = "keyVaultArmId", required = true) + private String keyVaultArmId; + + /** Creates an instance of KeyVaultProperties class. */ + public KeyVaultProperties() { + } + + /** + * Get the identityClientId property: Currently, we support only SystemAssigned MSI. We need this when we support + * UserAssignedIdentities. + * + * @return the identityClientId value. + */ + public String identityClientId() { + return this.identityClientId; + } + + /** + * Set the identityClientId property: Currently, we support only SystemAssigned MSI. We need this when we support + * UserAssignedIdentities. + * + * @param identityClientId the identityClientId value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentityClientId(String identityClientId) { + this.identityClientId = identityClientId; + return this; + } + + /** + * Get the keyIdentifier property: KeyVault key identifier to encrypt the data. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: KeyVault key identifier to encrypt the data. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the keyVaultArmId property: KeyVault Arm Id that contains the data encryption key. + * + * @return the keyVaultArmId value. + */ + public String keyVaultArmId() { + return this.keyVaultArmId; + } + + /** + * Set the keyVaultArmId property: KeyVault Arm Id that contains the data encryption key. + * + * @param keyVaultArmId the keyVaultArmId value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultArmId(String keyVaultArmId) { + this.keyVaultArmId = keyVaultArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyIdentifier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyIdentifier in model KeyVaultProperties")); + } + if (keyVaultArmId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultArmId in model KeyVaultProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultProperties.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java index 9a07bac3c9c53..eb13fce09821d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java @@ -53,6 +53,13 @@ public KubernetesOnlineDeployment withAppInsightsEnabled(Boolean appInsightsEnab return this; } + /** {@inheritDoc} */ + @Override + public KubernetesOnlineDeployment withDataCollector(DataCollector dataCollector) { + super.withDataCollector(dataCollector); + return this; + } + /** {@inheritDoc} */ @Override public KubernetesOnlineDeployment withEgressPublicNetworkAccess( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelCategory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelCategory.java new file mode 100644 index 0000000000000..fb678d8e6ef66 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelCategory.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Label category definition. */ +@Fluent +public final class LabelCategory { + /* + * Dictionary of label classes in this category. + */ + @JsonProperty(value = "classes") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map classes; + + /* + * Display name of the label category. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Indicates whether it is allowed to select multiple classes in this category. + */ + @JsonProperty(value = "multiSelect") + private MultiSelect multiSelect; + + /** Creates an instance of LabelCategory class. */ + public LabelCategory() { + } + + /** + * Get the classes property: Dictionary of label classes in this category. + * + * @return the classes value. + */ + public Map classes() { + return this.classes; + } + + /** + * Set the classes property: Dictionary of label classes in this category. + * + * @param classes the classes value to set. + * @return the LabelCategory object itself. + */ + public LabelCategory withClasses(Map classes) { + this.classes = classes; + return this; + } + + /** + * Get the displayName property: Display name of the label category. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the label category. + * + * @param displayName the displayName value to set. + * @return the LabelCategory object itself. + */ + public LabelCategory withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the multiSelect property: Indicates whether it is allowed to select multiple classes in this category. + * + * @return the multiSelect value. + */ + public MultiSelect multiSelect() { + return this.multiSelect; + } + + /** + * Set the multiSelect property: Indicates whether it is allowed to select multiple classes in this category. + * + * @param multiSelect the multiSelect value to set. + * @return the LabelCategory object itself. + */ + public LabelCategory withMultiSelect(MultiSelect multiSelect) { + this.multiSelect = multiSelect; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (classes() != null) { + classes() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelClass.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelClass.java new file mode 100644 index 0000000000000..e2cc32c60665b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelClass.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Label class definition. */ +@Fluent +public final class LabelClass { + /* + * Display name of the label class. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Dictionary of subclasses of the label class. + */ + @JsonProperty(value = "subclasses") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map subclasses; + + /** Creates an instance of LabelClass class. */ + public LabelClass() { + } + + /** + * Get the displayName property: Display name of the label class. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the label class. + * + * @param displayName the displayName value to set. + * @return the LabelClass object itself. + */ + public LabelClass withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the subclasses property: Dictionary of subclasses of the label class. + * + * @return the subclasses value. + */ + public Map subclasses() { + return this.subclasses; + } + + /** + * Set the subclasses property: Dictionary of subclasses of the label class. + * + * @param subclasses the subclasses value to set. + * @return the LabelClass object itself. + */ + public LabelClass withSubclasses(Map subclasses) { + this.subclasses = subclasses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subclasses() != null) { + subclasses() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingDataConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingDataConfiguration.java new file mode 100644 index 0000000000000..266f8aa4428f8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingDataConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Labeling data configuration definition. */ +@Fluent +public final class LabelingDataConfiguration { + /* + * Resource Id of the data asset to perform labeling. + */ + @JsonProperty(value = "dataId") + private String dataId; + + /* + * Indicates whether to enable incremental data refresh. + */ + @JsonProperty(value = "incrementalDataRefresh") + private IncrementalDataRefresh incrementalDataRefresh; + + /** Creates an instance of LabelingDataConfiguration class. */ + public LabelingDataConfiguration() { + } + + /** + * Get the dataId property: Resource Id of the data asset to perform labeling. + * + * @return the dataId value. + */ + public String dataId() { + return this.dataId; + } + + /** + * Set the dataId property: Resource Id of the data asset to perform labeling. + * + * @param dataId the dataId value to set. + * @return the LabelingDataConfiguration object itself. + */ + public LabelingDataConfiguration withDataId(String dataId) { + this.dataId = dataId; + return this; + } + + /** + * Get the incrementalDataRefresh property: Indicates whether to enable incremental data refresh. + * + * @return the incrementalDataRefresh value. + */ + public IncrementalDataRefresh incrementalDataRefresh() { + return this.incrementalDataRefresh; + } + + /** + * Set the incrementalDataRefresh property: Indicates whether to enable incremental data refresh. + * + * @param incrementalDataRefresh the incrementalDataRefresh value to set. + * @return the LabelingDataConfiguration object itself. + */ + public LabelingDataConfiguration withIncrementalDataRefresh(IncrementalDataRefresh incrementalDataRefresh) { + this.incrementalDataRefresh = incrementalDataRefresh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJob.java new file mode 100644 index 0000000000000..ff02ae2914c77 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJob.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; + +/** An immutable client-side representation of LabelingJob. */ +public interface LabelingJob { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + LabelingJobProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner object. + * + * @return the inner object. + */ + LabelingJobInner innerModel(); + + /** The entirety of the LabelingJob definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The LabelingJob definition stages. */ + interface DefinitionStages { + /** The first stage of the LabelingJob definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the LabelingJob definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** The stage of the LabelingJob definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(LabelingJobProperties properties); + } + + /** + * The stage of the LabelingJob definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + LabelingJob create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LabelingJob create(Context context); + } + } + + /** + * Begins update for the LabelingJob resource. + * + * @return the stage of resource update. + */ + LabelingJob.Update update(); + + /** The template for LabelingJob update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LabelingJob apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LabelingJob apply(Context context); + } + + /** The LabelingJob update stages. */ + interface UpdateStages { + /** The stage of the LabelingJob update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(LabelingJobProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LabelingJob refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LabelingJob refresh(Context context); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportSummary exportLabels(ExportSummaryInner body); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportSummary exportLabels(ExportSummaryInner body, Context context); + + /** + * Pause a labeling job. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response pauseWithResponse(Context context); + + /** + * Pause a labeling job. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pause(); + + /** + * Resume a labeling job (asynchronous). + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume(); + + /** + * Resume a labeling job (asynchronous). + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobImageProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobImageProperties.java new file mode 100644 index 0000000000000..2868d47897bb0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobImageProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a labeling job for image data. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mediaType") +@JsonTypeName("Image") +@Fluent +public final class LabelingJobImageProperties extends LabelingJobMediaProperties { + /* + * Annotation type of image labeling job. + */ + @JsonProperty(value = "annotationType") + private ImageAnnotationType annotationType; + + /** Creates an instance of LabelingJobImageProperties class. */ + public LabelingJobImageProperties() { + } + + /** + * Get the annotationType property: Annotation type of image labeling job. + * + * @return the annotationType value. + */ + public ImageAnnotationType annotationType() { + return this.annotationType; + } + + /** + * Set the annotationType property: Annotation type of image labeling job. + * + * @param annotationType the annotationType value to set. + * @return the LabelingJobImageProperties object itself. + */ + public LabelingJobImageProperties withAnnotationType(ImageAnnotationType annotationType) { + this.annotationType = annotationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobInstructions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobInstructions.java new file mode 100644 index 0000000000000..cadb65421d242 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobInstructions.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Instructions for labeling job. */ +@Fluent +public final class LabelingJobInstructions { + /* + * The link to a page with detailed labeling instructions for labelers. + */ + @JsonProperty(value = "uri") + private String uri; + + /** Creates an instance of LabelingJobInstructions class. */ + public LabelingJobInstructions() { + } + + /** + * Get the uri property: The link to a page with detailed labeling instructions for labelers. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The link to a page with detailed labeling instructions for labelers. + * + * @param uri the uri value to set. + * @return the LabelingJobInstructions object itself. + */ + public LabelingJobInstructions withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobMediaProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobMediaProperties.java new file mode 100644 index 0000000000000..d1c37858b3bfb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobMediaProperties.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a labeling job. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "mediaType", + defaultImpl = LabelingJobMediaProperties.class) +@JsonTypeName("LabelingJobMediaProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Image", value = LabelingJobImageProperties.class), + @JsonSubTypes.Type(name = "Text", value = LabelingJobTextProperties.class) +}) +@Immutable +public class LabelingJobMediaProperties { + /** Creates an instance of LabelingJobMediaProperties class. */ + public LabelingJobMediaProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobProperties.java new file mode 100644 index 0000000000000..353e1bfb8e72f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobProperties.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** Labeling job definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("Labeling") +@Fluent +public final class LabelingJobProperties extends JobBaseProperties { + /* + * Created time of the job in UTC timezone. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * Configuration of data used in the job. + */ + @JsonProperty(value = "dataConfiguration") + private LabelingDataConfiguration dataConfiguration; + + /* + * Labeling instructions of the job. + */ + @JsonProperty(value = "jobInstructions") + private LabelingJobInstructions jobInstructions; + + /* + * Label categories of the job. + */ + @JsonProperty(value = "labelCategories") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map labelCategories; + + /* + * Media type specific properties in the job. + */ + @JsonProperty(value = "labelingJobMediaProperties") + private LabelingJobMediaProperties labelingJobMediaProperties; + + /* + * Configuration of MLAssist feature in the job. + */ + @JsonProperty(value = "mlAssistConfiguration") + private MLAssistConfiguration mlAssistConfiguration; + + /* + * Progress metrics of the job. + */ + @JsonProperty(value = "progressMetrics", access = JsonProperty.Access.WRITE_ONLY) + private ProgressMetrics progressMetrics; + + /* + * Internal id of the job(Previously called project). + */ + @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID projectId; + + /* + * Specifies the labeling job provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private JobProvisioningState provisioningState; + + /* + * Status messages of the job. + */ + @JsonProperty(value = "statusMessages", access = JsonProperty.Access.WRITE_ONLY) + private List statusMessages; + + /** Creates an instance of LabelingJobProperties class. */ + public LabelingJobProperties() { + } + + /** + * Get the createdDateTime property: Created time of the job in UTC timezone. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the dataConfiguration property: Configuration of data used in the job. + * + * @return the dataConfiguration value. + */ + public LabelingDataConfiguration dataConfiguration() { + return this.dataConfiguration; + } + + /** + * Set the dataConfiguration property: Configuration of data used in the job. + * + * @param dataConfiguration the dataConfiguration value to set. + * @return the LabelingJobProperties object itself. + */ + public LabelingJobProperties withDataConfiguration(LabelingDataConfiguration dataConfiguration) { + this.dataConfiguration = dataConfiguration; + return this; + } + + /** + * Get the jobInstructions property: Labeling instructions of the job. + * + * @return the jobInstructions value. + */ + public LabelingJobInstructions jobInstructions() { + return this.jobInstructions; + } + + /** + * Set the jobInstructions property: Labeling instructions of the job. + * + * @param jobInstructions the jobInstructions value to set. + * @return the LabelingJobProperties object itself. + */ + public LabelingJobProperties withJobInstructions(LabelingJobInstructions jobInstructions) { + this.jobInstructions = jobInstructions; + return this; + } + + /** + * Get the labelCategories property: Label categories of the job. + * + * @return the labelCategories value. + */ + public Map labelCategories() { + return this.labelCategories; + } + + /** + * Set the labelCategories property: Label categories of the job. + * + * @param labelCategories the labelCategories value to set. + * @return the LabelingJobProperties object itself. + */ + public LabelingJobProperties withLabelCategories(Map labelCategories) { + this.labelCategories = labelCategories; + return this; + } + + /** + * Get the labelingJobMediaProperties property: Media type specific properties in the job. + * + * @return the labelingJobMediaProperties value. + */ + public LabelingJobMediaProperties labelingJobMediaProperties() { + return this.labelingJobMediaProperties; + } + + /** + * Set the labelingJobMediaProperties property: Media type specific properties in the job. + * + * @param labelingJobMediaProperties the labelingJobMediaProperties value to set. + * @return the LabelingJobProperties object itself. + */ + public LabelingJobProperties withLabelingJobMediaProperties(LabelingJobMediaProperties labelingJobMediaProperties) { + this.labelingJobMediaProperties = labelingJobMediaProperties; + return this; + } + + /** + * Get the mlAssistConfiguration property: Configuration of MLAssist feature in the job. + * + * @return the mlAssistConfiguration value. + */ + public MLAssistConfiguration mlAssistConfiguration() { + return this.mlAssistConfiguration; + } + + /** + * Set the mlAssistConfiguration property: Configuration of MLAssist feature in the job. + * + * @param mlAssistConfiguration the mlAssistConfiguration value to set. + * @return the LabelingJobProperties object itself. + */ + public LabelingJobProperties withMlAssistConfiguration(MLAssistConfiguration mlAssistConfiguration) { + this.mlAssistConfiguration = mlAssistConfiguration; + return this; + } + + /** + * Get the progressMetrics property: Progress metrics of the job. + * + * @return the progressMetrics value. + */ + public ProgressMetrics progressMetrics() { + return this.progressMetrics; + } + + /** + * Get the projectId property: Internal id of the job(Previously called project). + * + * @return the projectId value. + */ + public UUID projectId() { + return this.projectId; + } + + /** + * Get the provisioningState property: Specifies the labeling job provisioning state. + * + * @return the provisioningState value. + */ + public JobProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the statusMessages property: Status messages of the job. + * + * @return the statusMessages value. + */ + public List statusMessages() { + return this.statusMessages; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withComponentId(String componentId) { + super.withComponentId(componentId); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withComputeId(String computeId) { + super.withComputeId(computeId); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withExperimentName(String experimentName) { + super.withExperimentName(experimentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withIdentity(IdentityConfiguration identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withServices(Map services) { + super.withServices(services); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabelingJobProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataConfiguration() != null) { + dataConfiguration().validate(); + } + if (jobInstructions() != null) { + jobInstructions().validate(); + } + if (labelCategories() != null) { + labelCategories() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (labelingJobMediaProperties() != null) { + labelingJobMediaProperties().validate(); + } + if (mlAssistConfiguration() != null) { + mlAssistConfiguration().validate(); + } + if (progressMetrics() != null) { + progressMetrics().validate(); + } + if (statusMessages() != null) { + statusMessages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..a41dace4b2216 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobResourceArmPaginatedResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.LabelingJobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of LabelingJob entities. */ +@Fluent +public final class LabelingJobResourceArmPaginatedResult { + /* + * The link to the next page of LabelingJob objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type LabelingJob. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of LabelingJobResourceArmPaginatedResult class. */ + public LabelingJobResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of LabelingJob objects. If null, there are no additional + * pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of LabelingJob objects. If null, there are no additional + * pages. + * + * @param nextLink the nextLink value to set. + * @return the LabelingJobResourceArmPaginatedResult object itself. + */ + public LabelingJobResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type LabelingJob. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type LabelingJob. + * + * @param value the value value to set. + * @return the LabelingJobResourceArmPaginatedResult object itself. + */ + public LabelingJobResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobTextProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobTextProperties.java new file mode 100644 index 0000000000000..2214bbc535b9b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobTextProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a labeling job for text data. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mediaType") +@JsonTypeName("Text") +@Fluent +public final class LabelingJobTextProperties extends LabelingJobMediaProperties { + /* + * Annotation type of text labeling job. + */ + @JsonProperty(value = "annotationType") + private TextAnnotationType annotationType; + + /** Creates an instance of LabelingJobTextProperties class. */ + public LabelingJobTextProperties() { + } + + /** + * Get the annotationType property: Annotation type of text labeling job. + * + * @return the annotationType value. + */ + public TextAnnotationType annotationType() { + return this.annotationType; + } + + /** + * Set the annotationType property: Annotation type of text labeling job. + * + * @param annotationType the annotationType value to set. + * @return the LabelingJobTextProperties object itself. + */ + public LabelingJobTextProperties withAnnotationType(TextAnnotationType annotationType) { + this.annotationType = annotationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobs.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobs.java new file mode 100644 index 0000000000000..17763dba97aff --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LabelingJobs.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ExportSummaryInner; + +/** Resource collection API of LabelingJobs. */ +public interface LabelingJobs { + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists labeling jobs in the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param top Number of labeling jobs to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of LabelingJob entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String skip, Integer top, Context context); + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Delete a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String id); + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String id, + Boolean includeJobInstructions, + Boolean includeLabelCategories, + Context context); + + /** + * Gets a labeling job by name/id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id. + */ + LabelingJob get(String resourceGroupName, String workspaceName, String id); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportSummary exportLabels(String resourceGroupName, String workspaceName, String id, ExportSummaryInner body); + + /** + * Export labels from a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param body The export summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportSummary exportLabels( + String resourceGroupName, String workspaceName, String id, ExportSummaryInner body, Context context); + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response pauseWithResponse(String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Pause a labeling job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pause(String resourceGroupName, String workspaceName, String id); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume(String resourceGroupName, String workspaceName, String id); + + /** + * Resume a labeling job (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param id The name and identifier for the LabelingJob. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resume(String resourceGroupName, String workspaceName, String id, Context context); + + /** + * Gets a labeling job by name/id. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response}. + */ + LabelingJob getById(String id); + + /** + * Gets a labeling job by name/id. + * + * @param id the resource ID. + * @param includeJobInstructions Boolean value to indicate whether to include JobInstructions in response. + * @param includeLabelCategories Boolean value to indicate Whether to include LabelCategories in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a labeling job by name/id along with {@link Response}. + */ + Response getByIdWithResponse( + String id, Boolean includeJobInstructions, Boolean includeLabelCategories, Context context); + + /** + * Delete a labeling job. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a labeling job. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LabelingJob resource. + * + * @param name resource name. + * @return the first stage of the new LabelingJob definition. + */ + LabelingJob.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java new file mode 100644 index 0000000000000..bae7e4023d320 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The LakeHouseArtifact model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "artifactType") +@JsonTypeName("LakeHouse") +@Fluent +public final class LakeHouseArtifact extends OneLakeArtifact { + /** Creates an instance of LakeHouseArtifact class. */ + public LakeHouseArtifact() { + } + + /** {@inheritDoc} */ + @Override + public LakeHouseArtifact withArtifactName(String artifactName) { + super.withArtifactName(artifactName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java index 7ee8bc352a961..1d7fd1c4c8ac1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java @@ -9,14 +9,14 @@ /** An immutable client-side representation of ListNotebookKeysResult. */ public interface ListNotebookKeysResult { /** - * Gets the primaryAccessKey property: The primaryAccessKey property. + * Gets the primaryAccessKey property: The primary access key of the Notebook. * * @return the primaryAccessKey value. */ String primaryAccessKey(); /** - * Gets the secondaryAccessKey property: The secondaryAccessKey property. + * Gets the secondaryAccessKey property: The secondary access key of the Notebook. * * @return the secondaryAccessKey value. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java index 53a4f6c3e392d..8e3c5e5cb922d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java @@ -9,7 +9,7 @@ /** An immutable client-side representation of ListStorageAccountKeysResult. */ public interface ListStorageAccountKeysResult { /** - * Gets the userStorageKey property: The userStorageKey property. + * Gets the userStorageKey property: The access key of the storage. * * @return the userStorageKey value. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java index 37ea530b96fb2..7d5ad4d0a723f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java @@ -9,21 +9,7 @@ /** An immutable client-side representation of ListWorkspaceKeysResult. */ public interface ListWorkspaceKeysResult { /** - * Gets the userStorageKey property: The userStorageKey property. - * - * @return the userStorageKey value. - */ - String userStorageKey(); - - /** - * Gets the userStorageResourceId property: The userStorageResourceId property. - * - * @return the userStorageResourceId value. - */ - String userStorageResourceId(); - - /** - * Gets the appInsightsInstrumentationKey property: The appInsightsInstrumentationKey property. + * Gets the appInsightsInstrumentationKey property: The access key of the workspace app insights. * * @return the appInsightsInstrumentationKey value. */ @@ -43,6 +29,20 @@ public interface ListWorkspaceKeysResult { */ ListNotebookKeysResult notebookAccessKeys(); + /** + * Gets the userStorageArmId property: The arm Id key of the workspace storage. + * + * @return the userStorageArmId value. + */ + String userStorageArmId(); + + /** + * Gets the userStorageKey property: The access key of the workspace storage. + * + * @return the userStorageKey value. + */ + String userStorageKey(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ListWorkspaceKeysResultInner object. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogTrainingMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogTrainingMetrics.java new file mode 100644 index 0000000000000..c3eaae9b0a716 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogTrainingMetrics.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogTrainingMetrics. */ +public final class LogTrainingMetrics extends ExpandableStringEnum { + /** Static value Enable for LogTrainingMetrics. */ + public static final LogTrainingMetrics ENABLE = fromString("Enable"); + + /** Static value Disable for LogTrainingMetrics. */ + public static final LogTrainingMetrics DISABLE = fromString("Disable"); + + /** + * Creates a new instance of LogTrainingMetrics value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogTrainingMetrics() { + } + + /** + * Creates or finds a LogTrainingMetrics from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogTrainingMetrics. + */ + @JsonCreator + public static LogTrainingMetrics fromString(String name) { + return fromString(name, LogTrainingMetrics.class); + } + + /** + * Gets known LogTrainingMetrics values. + * + * @return known LogTrainingMetrics values. + */ + public static Collection values() { + return values(LogTrainingMetrics.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogValidationLoss.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogValidationLoss.java new file mode 100644 index 0000000000000..bdc4284c56322 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogValidationLoss.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogValidationLoss. */ +public final class LogValidationLoss extends ExpandableStringEnum { + /** Static value Enable for LogValidationLoss. */ + public static final LogValidationLoss ENABLE = fromString("Enable"); + + /** Static value Disable for LogValidationLoss. */ + public static final LogValidationLoss DISABLE = fromString("Disable"); + + /** + * Creates a new instance of LogValidationLoss value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogValidationLoss() { + } + + /** + * Creates or finds a LogValidationLoss from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogValidationLoss. + */ + @JsonCreator + public static LogValidationLoss fromString(String name) { + return fromString(name, LogValidationLoss.class); + } + + /** + * Gets known LogValidationLoss values. + * + * @return known LogValidationLoss values. + */ + public static Collection values() { + return values(LogValidationLoss.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfiguration.java new file mode 100644 index 0000000000000..7f1792ea61e25 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfiguration.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Labeling MLAssist configuration definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "mlAssist", + defaultImpl = MLAssistConfiguration.class) +@JsonTypeName("MLAssistConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Disabled", value = MLAssistConfigurationDisabled.class), + @JsonSubTypes.Type(name = "Enabled", value = MLAssistConfigurationEnabled.class) +}) +@Immutable +public class MLAssistConfiguration { + /** Creates an instance of MLAssistConfiguration class. */ + public MLAssistConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationDisabled.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationDisabled.java new file mode 100644 index 0000000000000..1555d0007913b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationDisabled.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Labeling MLAssist configuration definition when MLAssist is disabled. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mlAssist") +@JsonTypeName("Disabled") +@Immutable +public final class MLAssistConfigurationDisabled extends MLAssistConfiguration { + /** Creates an instance of MLAssistConfigurationDisabled class. */ + public MLAssistConfigurationDisabled() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationEnabled.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationEnabled.java new file mode 100644 index 0000000000000..a7beeffa663d5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationEnabled.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Labeling MLAssist configuration definition when MLAssist is enabled. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mlAssist") +@JsonTypeName("Enabled") +@Fluent +public final class MLAssistConfigurationEnabled extends MLAssistConfiguration { + /* + * [Required] AML compute binding used in inferencing. + */ + @JsonProperty(value = "inferencingComputeBinding", required = true) + private String inferencingComputeBinding; + + /* + * [Required] AML compute binding used in training. + */ + @JsonProperty(value = "trainingComputeBinding", required = true) + private String trainingComputeBinding; + + /** Creates an instance of MLAssistConfigurationEnabled class. */ + public MLAssistConfigurationEnabled() { + } + + /** + * Get the inferencingComputeBinding property: [Required] AML compute binding used in inferencing. + * + * @return the inferencingComputeBinding value. + */ + public String inferencingComputeBinding() { + return this.inferencingComputeBinding; + } + + /** + * Set the inferencingComputeBinding property: [Required] AML compute binding used in inferencing. + * + * @param inferencingComputeBinding the inferencingComputeBinding value to set. + * @return the MLAssistConfigurationEnabled object itself. + */ + public MLAssistConfigurationEnabled withInferencingComputeBinding(String inferencingComputeBinding) { + this.inferencingComputeBinding = inferencingComputeBinding; + return this; + } + + /** + * Get the trainingComputeBinding property: [Required] AML compute binding used in training. + * + * @return the trainingComputeBinding value. + */ + public String trainingComputeBinding() { + return this.trainingComputeBinding; + } + + /** + * Set the trainingComputeBinding property: [Required] AML compute binding used in training. + * + * @param trainingComputeBinding the trainingComputeBinding value to set. + * @return the MLAssistConfigurationEnabled object itself. + */ + public MLAssistConfigurationEnabled withTrainingComputeBinding(String trainingComputeBinding) { + this.trainingComputeBinding = trainingComputeBinding; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (inferencingComputeBinding() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property inferencingComputeBinding in model MLAssistConfigurationEnabled")); + } + if (trainingComputeBinding() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property trainingComputeBinding in model MLAssistConfigurationEnabled")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MLAssistConfigurationEnabled.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationType.java new file mode 100644 index 0000000000000..403749f908ccd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLAssistConfigurationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MLAssistConfigurationType. */ +public final class MLAssistConfigurationType extends ExpandableStringEnum { + /** Static value Enabled for MLAssistConfigurationType. */ + public static final MLAssistConfigurationType ENABLED = fromString("Enabled"); + + /** Static value Disabled for MLAssistConfigurationType. */ + public static final MLAssistConfigurationType DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MLAssistConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MLAssistConfigurationType() { + } + + /** + * Creates or finds a MLAssistConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MLAssistConfigurationType. + */ + @JsonCreator + public static MLAssistConfigurationType fromString(String name) { + return fromString(name, MLAssistConfigurationType.class); + } + + /** + * Gets known MLAssistConfigurationType values. + * + * @return known MLAssistConfigurationType values. + */ + public static Collection values() { + return values(MLAssistConfigurationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowAutologgerState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowAutologgerState.java new file mode 100644 index 0000000000000..7d6134daa6e2d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowAutologgerState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the state of mlflow autologger. */ +public final class MLFlowAutologgerState extends ExpandableStringEnum { + /** Static value Enabled for MLFlowAutologgerState. */ + public static final MLFlowAutologgerState ENABLED = fromString("Enabled"); + + /** Static value Disabled for MLFlowAutologgerState. */ + public static final MLFlowAutologgerState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MLFlowAutologgerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MLFlowAutologgerState() { + } + + /** + * Creates or finds a MLFlowAutologgerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MLFlowAutologgerState. + */ + @JsonCreator + public static MLFlowAutologgerState fromString(String name) { + return fromString(name, MLFlowAutologgerState.class); + } + + /** + * Gets known MLFlowAutologgerState values. + * + * @return known MLFlowAutologgerState values. + */ + public static Collection values() { + return values(MLFlowAutologgerState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java index e695c2c2e12c4..d9e976a4ad816 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("mlflow_model") @Fluent public final class MLFlowModelJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class MLFlowModelJobOutput extends JobOutput { public MLFlowModelJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the MLFlowModelJobOutput object itself. + */ + public MLFlowModelJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the MLFlowModelJobOutput object itself. + */ + public MLFlowModelJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the MLFlowModelJobOutput object itself. + */ + public MLFlowModelJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public MLFlowModelJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java index 009f42261a0e6..ce5a284dc72fb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java @@ -53,6 +53,27 @@ public MLTableData withDataUri(String dataUri) { return this; } + /** {@inheritDoc} */ + @Override + public MLTableData withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLTableData withStage(String stage) { + super.withStage(stage); + return this; + } + + /** {@inheritDoc} */ + @Override + public MLTableData withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public MLTableData withIsAnonymous(Boolean isAnonymous) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java index 168360d6a0155..369b457e68ad1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("mltable") @Fluent public final class MLTableJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class MLTableJobOutput extends JobOutput { public MLTableJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the MLTableJobOutput object itself. + */ + public MLTableJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the MLTableJobOutput object itself. + */ + public MLTableJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the MLTableJobOutput object itself. + */ + public MLTableJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public MLTableJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java new file mode 100644 index 0000000000000..43127d40745ba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Managed compute identity definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeIdentityType") +@JsonTypeName("ManagedIdentity") +@Fluent +public final class ManagedComputeIdentity extends MonitorComputeIdentityBase { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /** Creates an instance of ManagedComputeIdentity class. */ + public ManagedComputeIdentity() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ManagedComputeIdentity object itself. + */ + public ManagedComputeIdentity withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java index 6ff0f7e2b121d..8b943be0e5b3d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java @@ -14,7 +14,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "identityType") @JsonTypeName("Managed") @Fluent -public class ManagedIdentity extends IdentityConfiguration { +public final class ManagedIdentity extends IdentityConfiguration { /* * Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java index a117d892d2775..603f221ad167f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The ManagedIdentityAuthTypeWorkspaceConnectionProperties model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -54,22 +55,22 @@ public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCategory(Connect /** {@inheritDoc} */ @Override - public ManagedIdentityAuthTypeWorkspaceConnectionProperties withTarget(String target) { - super.withTarget(target); + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); return this; } /** {@inheritDoc} */ @Override - public ManagedIdentityAuthTypeWorkspaceConnectionProperties withValue(String value) { - super.withValue(value); + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); return this; } /** {@inheritDoc} */ @Override - public ManagedIdentityAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { - super.withValueFormat(valueFormat); + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java new file mode 100644 index 0000000000000..2c2f624159115 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed Network Provisioning options for managed network of a machine learning workspace. */ +@Fluent +public final class ManagedNetworkProvisionOptions { + /* + * The includeSpark property. + */ + @JsonProperty(value = "includeSpark") + private Boolean includeSpark; + + /** Creates an instance of ManagedNetworkProvisionOptions class. */ + public ManagedNetworkProvisionOptions() { + } + + /** + * Get the includeSpark property: The includeSpark property. + * + * @return the includeSpark value. + */ + public Boolean includeSpark() { + return this.includeSpark; + } + + /** + * Set the includeSpark property: The includeSpark property. + * + * @param includeSpark the includeSpark value to set. + * @return the ManagedNetworkProvisionOptions object itself. + */ + public ManagedNetworkProvisionOptions withIncludeSpark(Boolean includeSpark) { + this.includeSpark = includeSpark; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java new file mode 100644 index 0000000000000..b658d74d8ab48 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; + +/** An immutable client-side representation of ManagedNetworkProvisionStatus. */ +public interface ManagedNetworkProvisionStatus { + /** + * Gets the sparkReady property: The sparkReady property. + * + * @return the sparkReady value. + */ + Boolean sparkReady(); + + /** + * Gets the status property: Status for the managed network of a machine learning workspace. + * + * @return the status value. + */ + ManagedNetworkStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner object. + * + * @return the inner object. + */ + ManagedNetworkProvisionStatusInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java new file mode 100644 index 0000000000000..260d2d0d03d74 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.Context; + +/** Resource collection API of ManagedNetworkProvisions. */ +public interface ManagedNetworkProvisions { + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork( + String resourceGroupName, String workspaceName, ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java new file mode 100644 index 0000000000000..4e2c09a51e552 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedNetworkSettings. */ +public interface ManagedNetworkSettings { + /** + * Gets the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @return the isolationMode value. + */ + IsolationMode isolationMode(); + + /** + * Gets the networkId property: The networkId property. + * + * @return the networkId value. + */ + String networkId(); + + /** + * Gets the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + Map outboundRules(); + + /** + * Gets the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @return the status value. + */ + ManagedNetworkProvisionStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner object. + * + * @return the inner object. + */ + ManagedNetworkSettingsInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java new file mode 100644 index 0000000000000..4de1d6fc87b3d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedNetworkSettingsRules. */ +public interface ManagedNetworkSettingsRules { + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + OutboundRuleBasicResource get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + OutboundRuleBasicResource getById(String id); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OutboundRuleBasicResource resource. + * + * @param name resource name. + * @return the first stage of the new OutboundRuleBasicResource definition. + */ + OutboundRuleBasicResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java new file mode 100644 index 0000000000000..fa8e2640625f2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status for the managed network of a machine learning workspace. */ +public final class ManagedNetworkStatus extends ExpandableStringEnum { + /** Static value Inactive for ManagedNetworkStatus. */ + public static final ManagedNetworkStatus INACTIVE = fromString("Inactive"); + + /** Static value Active for ManagedNetworkStatus. */ + public static final ManagedNetworkStatus ACTIVE = fromString("Active"); + + /** + * Creates a new instance of ManagedNetworkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedNetworkStatus() { + } + + /** + * Creates or finds a ManagedNetworkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedNetworkStatus. + */ + @JsonCreator + public static ManagedNetworkStatus fromString(String name) { + return fromString(name, ManagedNetworkStatus.class); + } + + /** + * Gets known ManagedNetworkStatus values. + * + * @return known ManagedNetworkStatus values. + */ + public static Collection values() { + return values(ManagedNetworkStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java index 41a6593e52d78..3ec4b4de510e5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java @@ -25,6 +25,13 @@ public ManagedOnlineDeployment withAppInsightsEnabled(Boolean appInsightsEnabled return this; } + /** {@inheritDoc} */ + @Override + public ManagedOnlineDeployment withDataCollector(DataCollector dataCollector) { + super.withDataCollector(dataCollector); + return this; + } + /** {@inheritDoc} */ @Override public ManagedOnlineDeployment withEgressPublicNetworkAccess( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java new file mode 100644 index 0000000000000..71e61680f9178 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dto object representing compute resource. */ +@Fluent +public final class MaterializationComputeResource { + /* + * Specifies the instance type + */ + @JsonProperty(value = "instanceType") + private String instanceType; + + /** Creates an instance of MaterializationComputeResource class. */ + public MaterializationComputeResource() { + } + + /** + * Get the instanceType property: Specifies the instance type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: Specifies the instance type. + * + * @param instanceType the instanceType value to set. + * @return the MaterializationComputeResource object itself. + */ + public MaterializationComputeResource withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java new file mode 100644 index 0000000000000..86d88fb8660c5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The MaterializationSettings model. */ +@Fluent +public final class MaterializationSettings { + /* + * Specifies the notification details + */ + @JsonProperty(value = "notification") + private NotificationSetting notification; + + /* + * Specifies the compute resource settings + */ + @JsonProperty(value = "resource") + private MaterializationComputeResource resource; + + /* + * Specifies the schedule details + */ + @JsonProperty(value = "schedule") + private RecurrenceTrigger schedule; + + /* + * Specifies the spark compute settings + */ + @JsonProperty(value = "sparkConfiguration") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map sparkConfiguration; + + /* + * Specifies the stores to which materialization should happen + */ + @JsonProperty(value = "storeType") + private MaterializationStoreType storeType; + + /** Creates an instance of MaterializationSettings class. */ + public MaterializationSettings() { + } + + /** + * Get the notification property: Specifies the notification details. + * + * @return the notification value. + */ + public NotificationSetting notification() { + return this.notification; + } + + /** + * Set the notification property: Specifies the notification details. + * + * @param notification the notification value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withNotification(NotificationSetting notification) { + this.notification = notification; + return this; + } + + /** + * Get the resource property: Specifies the compute resource settings. + * + * @return the resource value. + */ + public MaterializationComputeResource resource() { + return this.resource; + } + + /** + * Set the resource property: Specifies the compute resource settings. + * + * @param resource the resource value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withResource(MaterializationComputeResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the schedule property: Specifies the schedule details. + * + * @return the schedule value. + */ + public RecurrenceTrigger schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Specifies the schedule details. + * + * @param schedule the schedule value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withSchedule(RecurrenceTrigger schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the sparkConfiguration property: Specifies the spark compute settings. + * + * @return the sparkConfiguration value. + */ + public Map sparkConfiguration() { + return this.sparkConfiguration; + } + + /** + * Set the sparkConfiguration property: Specifies the spark compute settings. + * + * @param sparkConfiguration the sparkConfiguration value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withSparkConfiguration(Map sparkConfiguration) { + this.sparkConfiguration = sparkConfiguration; + return this; + } + + /** + * Get the storeType property: Specifies the stores to which materialization should happen. + * + * @return the storeType value. + */ + public MaterializationStoreType storeType() { + return this.storeType; + } + + /** + * Set the storeType property: Specifies the stores to which materialization should happen. + * + * @param storeType the storeType value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withStoreType(MaterializationStoreType storeType) { + this.storeType = storeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (notification() != null) { + notification().validate(); + } + if (resource() != null) { + resource().validate(); + } + if (schedule() != null) { + schedule().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java new file mode 100644 index 0000000000000..dd37de51ae375 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MaterializationStoreType. */ +public final class MaterializationStoreType extends ExpandableStringEnum { + /** Static value None for MaterializationStoreType. */ + public static final MaterializationStoreType NONE = fromString("None"); + + /** Static value Online for MaterializationStoreType. */ + public static final MaterializationStoreType ONLINE = fromString("Online"); + + /** Static value Offline for MaterializationStoreType. */ + public static final MaterializationStoreType OFFLINE = fromString("Offline"); + + /** Static value OnlineAndOffline for MaterializationStoreType. */ + public static final MaterializationStoreType ONLINE_AND_OFFLINE = fromString("OnlineAndOffline"); + + /** + * Creates a new instance of MaterializationStoreType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaterializationStoreType() { + } + + /** + * Creates or finds a MaterializationStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaterializationStoreType. + */ + @JsonCreator + public static MaterializationStoreType fromString(String name) { + return fromString(name, MaterializationStoreType.class); + } + + /** + * Gets known MaterializationStoreType values. + * + * @return known MaterializationStoreType values. + */ + public static Collection values() { + return values(MaterializationStoreType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MediaType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MediaType.java new file mode 100644 index 0000000000000..4314254a8edaa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MediaType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Media type of data asset. */ +public final class MediaType extends ExpandableStringEnum { + /** Static value Image for MediaType. */ + public static final MediaType IMAGE = fromString("Image"); + + /** Static value Text for MediaType. */ + public static final MediaType TEXT = fromString("Text"); + + /** + * Creates a new instance of MediaType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MediaType() { + } + + /** + * Creates or finds a MediaType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaType. + */ + @JsonCreator + public static MediaType fromString(String name) { + return fromString(name, MediaType.class); + } + + /** + * Gets known MediaType values. + * + * @return known MediaType values. + */ + public static Collection values() { + return values(MediaType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MlflowAutologger.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MlflowAutologger.java new file mode 100644 index 0000000000000..d4cb5e0c20439 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MlflowAutologger.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether mlflow autologger is enabled for notebooks. */ +public final class MlflowAutologger extends ExpandableStringEnum { + /** Static value Enabled for MlflowAutologger. */ + public static final MlflowAutologger ENABLED = fromString("Enabled"); + + /** Static value Disabled for MlflowAutologger. */ + public static final MlflowAutologger DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MlflowAutologger value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MlflowAutologger() { + } + + /** + * Creates or finds a MlflowAutologger from its string representation. + * + * @param name a name to look for. + * @return the corresponding MlflowAutologger. + */ + @JsonCreator + public static MlflowAutologger fromString(String name) { + return fromString(name, MlflowAutologger.class); + } + + /** + * Gets known MlflowAutologger values. + * + * @return known MlflowAutologger values. + */ + public static Collection values() { + return values(MlflowAutologger.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelConfiguration.java new file mode 100644 index 0000000000000..f3f1c07401d04 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Model configuration options. */ +@Fluent +public final class ModelConfiguration { + /* + * Input delivery mode for the model. + */ + @JsonProperty(value = "mode") + private PackageInputDeliveryMode mode; + + /* + * Relative mounting path of the model in the target image. + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** Creates an instance of ModelConfiguration class. */ + public ModelConfiguration() { + } + + /** + * Get the mode property: Input delivery mode for the model. + * + * @return the mode value. + */ + public PackageInputDeliveryMode mode() { + return this.mode; + } + + /** + * Set the mode property: Input delivery mode for the model. + * + * @param mode the mode value to set. + * @return the ModelConfiguration object itself. + */ + public ModelConfiguration withMode(PackageInputDeliveryMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the mountPath property: Relative mounting path of the model in the target image. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Relative mounting path of the model in the target image. + * + * @param mountPath the mountPath value to set. + * @return the ModelConfiguration object itself. + */ + public ModelConfiguration withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java index 0841f457eef91..43ca8e4f48fd5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java @@ -66,22 +66,25 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The ModelContainer definition stages. */ interface DefinitionStages { /** The first stage of the ModelContainer definition. */ interface Blank extends WithParentResource { } + /** The stage of the ModelContainer definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. + * Specifies resourceGroupName, registryName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } + /** The stage of the ModelContainer definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(ModelContainerProperties properties); } + /** * The stage of the ModelContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { ModelContainer create(Context context); } } + /** * Begins update for the ModelContainer resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ ModelContainer apply(Context context); } + /** The ModelContainer update stages. */ interface UpdateStages { /** The stage of the ModelContainer update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(ModelContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java index aaf2c9cb402a9..f2a5d02d7fb0b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java @@ -5,15 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The ModelContainerProperties model. */ @Fluent public final class ModelContainerProperties extends AssetContainer { + /* + * Provisioning state for the model container. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + /** Creates an instance of ModelContainerProperties class. */ public ModelContainerProperties() { } + /** + * Get the provisioningState property: Provisioning state for the model container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + /** {@inheritDoc} */ @Override public ModelContainerProperties withIsArchived(Boolean isArchived) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java index e6173d6d334ed..09bf76c60a391 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; /** Resource collection API of ModelContainers. */ public interface ModelContainers { @@ -99,55 +100,33 @@ Response getWithResponse( ModelContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - ModelContainer getById(String id); - - /** - * Get container. + * Create or update container. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - void deleteById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String name, ModelContainerInner body, Context context); /** - * Delete container. + * Create or update container. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ModelContainer resource. - * - * @param name resource name. - * @return the first stage of the new ModelContainer definition. + * @return azure Resource Manager resource envelope. */ - ModelContainer.DefinitionStages.Blank define(String name); + ModelContainer createOrUpdate( + String resourceGroupName, String workspaceName, String name, ModelContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPackageInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPackageInput.java new file mode 100644 index 0000000000000..d845ad2d57196 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPackageInput.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Model package input options. */ +@Fluent +public final class ModelPackageInput { + /* + * [Required] Type of the input included in the target image. + */ + @JsonProperty(value = "inputType", required = true) + private PackageInputType inputType; + + /* + * Input delivery mode of the input. + */ + @JsonProperty(value = "mode") + private PackageInputDeliveryMode mode; + + /* + * Relative mount path of the input in the target image. + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /* + * [Required] Location of the input. + */ + @JsonProperty(value = "path", required = true) + private PackageInputPathBase path; + + /** Creates an instance of ModelPackageInput class. */ + public ModelPackageInput() { + } + + /** + * Get the inputType property: [Required] Type of the input included in the target image. + * + * @return the inputType value. + */ + public PackageInputType inputType() { + return this.inputType; + } + + /** + * Set the inputType property: [Required] Type of the input included in the target image. + * + * @param inputType the inputType value to set. + * @return the ModelPackageInput object itself. + */ + public ModelPackageInput withInputType(PackageInputType inputType) { + this.inputType = inputType; + return this; + } + + /** + * Get the mode property: Input delivery mode of the input. + * + * @return the mode value. + */ + public PackageInputDeliveryMode mode() { + return this.mode; + } + + /** + * Set the mode property: Input delivery mode of the input. + * + * @param mode the mode value to set. + * @return the ModelPackageInput object itself. + */ + public ModelPackageInput withMode(PackageInputDeliveryMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the mountPath property: Relative mount path of the input in the target image. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Relative mount path of the input in the target image. + * + * @param mountPath the mountPath value to set. + * @return the ModelPackageInput object itself. + */ + public ModelPackageInput withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the path property: [Required] Location of the input. + * + * @return the path value. + */ + public PackageInputPathBase path() { + return this.path; + } + + /** + * Set the path property: [Required] Location of the input. + * + * @param path the path value to set. + * @return the ModelPackageInput object itself. + */ + public ModelPackageInput withPath(PackageInputPathBase path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property inputType in model ModelPackageInput")); + } + if (path() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property path in model ModelPackageInput")); + } else { + path().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ModelPackageInput.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceMetricThresholdBase.java new file mode 100644 index 0000000000000..32fe4d757542f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceMetricThresholdBase.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The ModelPerformanceMetricThresholdBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "modelType", + defaultImpl = ModelPerformanceMetricThresholdBase.class) +@JsonTypeName("ModelPerformanceMetricThresholdBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Classification", value = ClassificationModelPerformanceMetricThreshold.class), + @JsonSubTypes.Type(name = "Regression", value = RegressionModelPerformanceMetricThreshold.class) +}) +@Fluent +public class ModelPerformanceMetricThresholdBase { + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of ModelPerformanceMetricThresholdBase class. */ + public ModelPerformanceMetricThresholdBase() { + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the ModelPerformanceMetricThresholdBase object itself. + */ + public ModelPerformanceMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceSignal.java new file mode 100644 index 0000000000000..38a744f86984f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelPerformanceSignal.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Model performance signal definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("ModelPerformance") +@Fluent +public final class ModelPerformanceSignal extends MonitoringSignalBase { + /* + * The data segment. + */ + @JsonProperty(value = "dataSegment") + private MonitoringDataSegment dataSegment; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThreshold", required = true) + private ModelPerformanceMetricThresholdBase metricThreshold; + + /* + * [Required] The data produced by the production service which drift will be calculated for. + */ + @JsonProperty(value = "productionData", required = true) + private List productionData; + + /* + * [Required] The data to calculate drift against. + */ + @JsonProperty(value = "referenceData", required = true) + private MonitoringInputDataBase referenceData; + + /** Creates an instance of ModelPerformanceSignal class. */ + public ModelPerformanceSignal() { + } + + /** + * Get the dataSegment property: The data segment. + * + * @return the dataSegment value. + */ + public MonitoringDataSegment dataSegment() { + return this.dataSegment; + } + + /** + * Set the dataSegment property: The data segment. + * + * @param dataSegment the dataSegment value to set. + * @return the ModelPerformanceSignal object itself. + */ + public ModelPerformanceSignal withDataSegment(MonitoringDataSegment dataSegment) { + this.dataSegment = dataSegment; + return this; + } + + /** + * Get the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThreshold value. + */ + public ModelPerformanceMetricThresholdBase metricThreshold() { + return this.metricThreshold; + } + + /** + * Set the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThreshold the metricThreshold value to set. + * @return the ModelPerformanceSignal object itself. + */ + public ModelPerformanceSignal withMetricThreshold(ModelPerformanceMetricThresholdBase metricThreshold) { + this.metricThreshold = metricThreshold; + return this; + } + + /** + * Get the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @return the productionData value. + */ + public List productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @param productionData the productionData value to set. + * @return the ModelPerformanceSignal object itself. + */ + public ModelPerformanceSignal withProductionData(List productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the ModelPerformanceSignal object itself. + */ + public ModelPerformanceSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** {@inheritDoc} */ + @Override + public ModelPerformanceSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public ModelPerformanceSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSegment() != null) { + dataSegment().validate(); + } + if (metricThreshold() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThreshold in model ModelPerformanceSignal")); + } else { + metricThreshold().validate(); + } + if (productionData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productionData in model ModelPerformanceSignal")); + } else { + productionData().forEach(e -> e.validate()); + } + if (referenceData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property referenceData in model ModelPerformanceSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ModelPerformanceSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java new file mode 100644 index 0000000000000..7ccea60e543d1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Model task type enum. */ +public final class ModelTaskType extends ExpandableStringEnum { + /** Static value Classification for ModelTaskType. */ + public static final ModelTaskType CLASSIFICATION = fromString("Classification"); + + /** Static value Regression for ModelTaskType. */ + public static final ModelTaskType REGRESSION = fromString("Regression"); + + /** Static value QuestionAnswering for ModelTaskType. */ + public static final ModelTaskType QUESTION_ANSWERING = fromString("QuestionAnswering"); + + /** + * Creates a new instance of ModelTaskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ModelTaskType() { + } + + /** + * Creates or finds a ModelTaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ModelTaskType. + */ + @JsonCreator + public static ModelTaskType fromString(String name) { + return fromString(name, ModelTaskType.class); + } + + /** + * Gets known ModelTaskType values. + * + * @return known ModelTaskType values. + */ + public static Collection values() { + return values(ModelTaskType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java index 6d8d49f169842..95d97ef3d8937 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; @@ -66,23 +67,26 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The ModelVersion definition stages. */ interface DefinitionStages { /** The first stage of the ModelVersion definition. */ interface Blank extends WithParentResource { } + /** The stage of the ModelVersion definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. + * Specifies resourceGroupName, registryName, modelName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. * @return the next definition stage. */ - WithProperties withExistingModel(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingModel(String resourceGroupName, String registryName, String modelName); } + /** The stage of the ModelVersion definition allowing to specify properties. */ interface WithProperties { /** @@ -93,6 +97,7 @@ interface WithProperties { */ WithCreate withProperties(ModelVersionProperties properties); } + /** * The stage of the ModelVersion definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -114,6 +119,7 @@ interface WithCreate { ModelVersion create(Context context); } } + /** * Begins update for the ModelVersion resource. * @@ -138,6 +144,7 @@ interface Update extends UpdateStages.WithProperties { */ ModelVersion apply(Context context); } + /** The ModelVersion update stages. */ interface UpdateStages { /** The stage of the ModelVersion update allowing to specify properties. */ @@ -151,6 +158,7 @@ interface WithProperties { Update withProperties(ModelVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. * @@ -165,4 +173,51 @@ interface WithProperties { * @return the refreshed resource. */ ModelVersion refresh(Context context); + + /** + * Model Version Package operation. + * + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + PackageResponse packageMethod(PackageRequest body); + + /** + * Model Version Package operation. + * + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + PackageResponse packageMethod(PackageRequest body, Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java index 93b7cedb104b1..22e73776d2d25 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java @@ -19,6 +19,12 @@ public final class ModelVersionProperties extends AssetBase { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map flavors; + /* + * Intellectual Property details. Used if model is an Intellectual Property. + */ + @JsonProperty(value = "intellectualProperty") + private IntellectualProperty intellectualProperty; + /* * Name of the training job which produced this model */ @@ -37,6 +43,18 @@ public final class ModelVersionProperties extends AssetBase { @JsonProperty(value = "modelUri") private String modelUri; + /* + * Provisioning state for the model version. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AssetProvisioningState provisioningState; + + /* + * Stage in the model lifecycle assigned to this model + */ + @JsonProperty(value = "stage") + private String stage; + /** Creates an instance of ModelVersionProperties class. */ public ModelVersionProperties() { } @@ -61,6 +79,26 @@ public ModelVersionProperties withFlavors(Map flavors) { return this; } + /** + * Get the intellectualProperty property: Intellectual Property details. Used if model is an Intellectual Property. + * + * @return the intellectualProperty value. + */ + public IntellectualProperty intellectualProperty() { + return this.intellectualProperty; + } + + /** + * Set the intellectualProperty property: Intellectual Property details. Used if model is an Intellectual Property. + * + * @param intellectualProperty the intellectualProperty value to set. + * @return the ModelVersionProperties object itself. + */ + public ModelVersionProperties withIntellectualProperty(IntellectualProperty intellectualProperty) { + this.intellectualProperty = intellectualProperty; + return this; + } + /** * Get the jobName property: Name of the training job which produced this model. * @@ -121,6 +159,42 @@ public ModelVersionProperties withModelUri(String modelUri) { return this; } + /** + * Get the provisioningState property: Provisioning state for the model version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Stage in the model lifecycle assigned to this model. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the model lifecycle assigned to this model. + * + * @param stage the stage value to set. + * @return the ModelVersionProperties object itself. + */ + public ModelVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** {@inheritDoc} */ + @Override + public ModelVersionProperties withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public ModelVersionProperties withIsAnonymous(Boolean isAnonymous) { @@ -174,5 +248,8 @@ public void validate() { } }); } + if (intellectualProperty() != null) { + intellectualProperty().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java index 050389e0716e0..1d6ad9653fdeb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; /** Resource collection API of ModelVersions. */ public interface ModelVersions { @@ -39,6 +40,7 @@ public interface ModelVersions { * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. * @param feed Name of the feed. * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Model stage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -59,6 +61,7 @@ PagedIterable list( String properties, String feed, ListViewType listViewType, + String stage, Context context); /** @@ -121,55 +124,78 @@ Response getWithResponse( ModelVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. + * Create or update version. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - ModelVersion getById(String id); + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String name, + String version, + ModelVersionInner body, + Context context); /** - * Get version. + * Create or update version. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + ModelVersion createOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body); /** - * Delete version. + * Model Version Package operation. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. */ - void deleteById(String id); + PackageResponse packageMethod( + String resourceGroupName, String workspaceName, String name, String version, PackageRequest body); /** - * Delete version. + * Model Version Package operation. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return package response returned after async package operation completes successfully. */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ModelVersion resource. - * - * @param name resource name. - * @return the first stage of the new ModelVersion definition. - */ - ModelVersion.DefinitionStages.Blank define(String name); + PackageResponse packageMethod( + String resourceGroupName, + String workspaceName, + String name, + String version, + PackageRequest body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java new file mode 100644 index 0000000000000..8791110a579b5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Monitor compute configuration base definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "computeType", + defaultImpl = MonitorComputeConfigurationBase.class) +@JsonTypeName("MonitorComputeConfigurationBase") +@JsonSubTypes({@JsonSubTypes.Type(name = "ServerlessSpark", value = MonitorServerlessSparkCompute.class)}) +@Immutable +public class MonitorComputeConfigurationBase { + /** Creates an instance of MonitorComputeConfigurationBase class. */ + public MonitorComputeConfigurationBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java new file mode 100644 index 0000000000000..2b5d35d2ca64b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Monitor compute identity base definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "computeIdentityType", + defaultImpl = MonitorComputeIdentityBase.class) +@JsonTypeName("MonitorComputeIdentityBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AmlToken", value = AmlTokenComputeIdentity.class), + @JsonSubTypes.Type(name = "ManagedIdentity", value = ManagedComputeIdentity.class) +}) +@Immutable +public class MonitorComputeIdentityBase { + /** Creates an instance of MonitorComputeIdentityBase class. */ + public MonitorComputeIdentityBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java new file mode 100644 index 0000000000000..026df51eb14b8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Monitor compute identity type enum. */ +public final class MonitorComputeIdentityType extends ExpandableStringEnum { + /** Static value AmlToken for MonitorComputeIdentityType. */ + public static final MonitorComputeIdentityType AML_TOKEN = fromString("AmlToken"); + + /** Static value ManagedIdentity for MonitorComputeIdentityType. */ + public static final MonitorComputeIdentityType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Creates a new instance of MonitorComputeIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitorComputeIdentityType() { + } + + /** + * Creates or finds a MonitorComputeIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitorComputeIdentityType. + */ + @JsonCreator + public static MonitorComputeIdentityType fromString(String name) { + return fromString(name, MonitorComputeIdentityType.class); + } + + /** + * Gets known MonitorComputeIdentityType values. + * + * @return known MonitorComputeIdentityType values. + */ + public static Collection values() { + return values(MonitorComputeIdentityType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java new file mode 100644 index 0000000000000..2393092bb37ee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Monitor compute type enum. */ +public final class MonitorComputeType extends ExpandableStringEnum { + /** Static value ServerlessSpark for MonitorComputeType. */ + public static final MonitorComputeType SERVERLESS_SPARK = fromString("ServerlessSpark"); + + /** + * Creates a new instance of MonitorComputeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitorComputeType() { + } + + /** + * Creates or finds a MonitorComputeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitorComputeType. + */ + @JsonCreator + public static MonitorComputeType fromString(String name) { + return fromString(name, MonitorComputeType.class); + } + + /** + * Gets known MonitorComputeType values. + * + * @return known MonitorComputeType values. + */ + public static Collection values() { + return values(MonitorComputeType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java new file mode 100644 index 0000000000000..7eb0fc84d4a98 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The MonitorDefinition model. */ +@Fluent +public final class MonitorDefinition { + /* + * The monitor's notification settings. + */ + @JsonProperty(value = "alertNotificationSetting") + private MonitoringAlertNotificationSettingsBase alertNotificationSetting; + + /* + * [Required] The ARM resource ID of the compute resource to run the monitoring job on. + */ + @JsonProperty(value = "computeConfiguration", required = true) + private MonitorComputeConfigurationBase computeConfiguration; + + /* + * The ARM resource ID of either the model or deployment targeted by this monitor. + */ + @JsonProperty(value = "monitoringTarget") + private MonitoringTarget monitoringTarget; + + /* + * [Required] The signals to monitor. + */ + @JsonProperty(value = "signals", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map signals; + + /** Creates an instance of MonitorDefinition class. */ + public MonitorDefinition() { + } + + /** + * Get the alertNotificationSetting property: The monitor's notification settings. + * + * @return the alertNotificationSetting value. + */ + public MonitoringAlertNotificationSettingsBase alertNotificationSetting() { + return this.alertNotificationSetting; + } + + /** + * Set the alertNotificationSetting property: The monitor's notification settings. + * + * @param alertNotificationSetting the alertNotificationSetting value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withAlertNotificationSetting( + MonitoringAlertNotificationSettingsBase alertNotificationSetting) { + this.alertNotificationSetting = alertNotificationSetting; + return this; + } + + /** + * Get the computeConfiguration property: [Required] The ARM resource ID of the compute resource to run the + * monitoring job on. + * + * @return the computeConfiguration value. + */ + public MonitorComputeConfigurationBase computeConfiguration() { + return this.computeConfiguration; + } + + /** + * Set the computeConfiguration property: [Required] The ARM resource ID of the compute resource to run the + * monitoring job on. + * + * @param computeConfiguration the computeConfiguration value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withComputeConfiguration(MonitorComputeConfigurationBase computeConfiguration) { + this.computeConfiguration = computeConfiguration; + return this; + } + + /** + * Get the monitoringTarget property: The ARM resource ID of either the model or deployment targeted by this + * monitor. + * + * @return the monitoringTarget value. + */ + public MonitoringTarget monitoringTarget() { + return this.monitoringTarget; + } + + /** + * Set the monitoringTarget property: The ARM resource ID of either the model or deployment targeted by this + * monitor. + * + * @param monitoringTarget the monitoringTarget value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withMonitoringTarget(MonitoringTarget monitoringTarget) { + this.monitoringTarget = monitoringTarget; + return this; + } + + /** + * Get the signals property: [Required] The signals to monitor. + * + * @return the signals value. + */ + public Map signals() { + return this.signals; + } + + /** + * Set the signals property: [Required] The signals to monitor. + * + * @param signals the signals value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withSignals(Map signals) { + this.signals = signals; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertNotificationSetting() != null) { + alertNotificationSetting().validate(); + } + if (computeConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property computeConfiguration in model MonitorDefinition")); + } else { + computeConfiguration().validate(); + } + if (monitoringTarget() != null) { + monitoringTarget().validate(); + } + if (signals() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property signals in model MonitorDefinition")); + } else { + signals() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorDefinition.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java new file mode 100644 index 0000000000000..85bc63049d52e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Monitor serverless spark compute definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") +@JsonTypeName("ServerlessSpark") +@Fluent +public final class MonitorServerlessSparkCompute extends MonitorComputeConfigurationBase { + /* + * [Required] The identity scheme leveraged to by the spark jobs running on serverless Spark. + */ + @JsonProperty(value = "computeIdentity", required = true) + private MonitorComputeIdentityBase computeIdentity; + + /* + * [Required] The instance type running the Spark job. + */ + @JsonProperty(value = "instanceType", required = true) + private String instanceType; + + /* + * [Required] The Spark runtime version. + */ + @JsonProperty(value = "runtimeVersion", required = true) + private String runtimeVersion; + + /** Creates an instance of MonitorServerlessSparkCompute class. */ + public MonitorServerlessSparkCompute() { + } + + /** + * Get the computeIdentity property: [Required] The identity scheme leveraged to by the spark jobs running on + * serverless Spark. + * + * @return the computeIdentity value. + */ + public MonitorComputeIdentityBase computeIdentity() { + return this.computeIdentity; + } + + /** + * Set the computeIdentity property: [Required] The identity scheme leveraged to by the spark jobs running on + * serverless Spark. + * + * @param computeIdentity the computeIdentity value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withComputeIdentity(MonitorComputeIdentityBase computeIdentity) { + this.computeIdentity = computeIdentity; + return this; + } + + /** + * Get the instanceType property: [Required] The instance type running the Spark job. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: [Required] The instance type running the Spark job. + * + * @param instanceType the instanceType value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the runtimeVersion property: [Required] The Spark runtime version. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: [Required] The Spark runtime version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (computeIdentity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property computeIdentity in model MonitorServerlessSparkCompute")); + } else { + computeIdentity().validate(); + } + if (instanceType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property instanceType in model MonitorServerlessSparkCompute")); + } + if (runtimeVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property runtimeVersion in model MonitorServerlessSparkCompute")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorServerlessSparkCompute.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationSettingsBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationSettingsBase.java new file mode 100644 index 0000000000000..1e96575c435e2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationSettingsBase.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MonitoringAlertNotificationSettingsBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "alertNotificationType", + defaultImpl = MonitoringAlertNotificationSettingsBase.class) +@JsonTypeName("MonitoringAlertNotificationSettingsBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureMonitor", value = AzMonMonitoringAlertNotificationSettings.class), + @JsonSubTypes.Type(name = "Email", value = EmailMonitoringAlertNotificationSettings.class) +}) +@Immutable +public class MonitoringAlertNotificationSettingsBase { + /** Creates an instance of MonitoringAlertNotificationSettingsBase class. */ + public MonitoringAlertNotificationSettingsBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationType.java new file mode 100644 index 0000000000000..ec4851e9637d7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringAlertNotificationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringAlertNotificationType. */ +public final class MonitoringAlertNotificationType extends ExpandableStringEnum { + /** Static value AzureMonitor for MonitoringAlertNotificationType. */ + public static final MonitoringAlertNotificationType AZURE_MONITOR = fromString("AzureMonitor"); + + /** Static value Email for MonitoringAlertNotificationType. */ + public static final MonitoringAlertNotificationType EMAIL = fromString("Email"); + + /** + * Creates a new instance of MonitoringAlertNotificationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringAlertNotificationType() { + } + + /** + * Creates or finds a MonitoringAlertNotificationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringAlertNotificationType. + */ + @JsonCreator + public static MonitoringAlertNotificationType fromString(String name) { + return fromString(name, MonitoringAlertNotificationType.class); + } + + /** + * Gets known MonitoringAlertNotificationType values. + * + * @return known MonitoringAlertNotificationType values. + */ + public static Collection values() { + return values(MonitoringAlertNotificationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringDataSegment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringDataSegment.java new file mode 100644 index 0000000000000..8ad8b15fca43a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringDataSegment.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MonitoringDataSegment model. */ +@Fluent +public final class MonitoringDataSegment { + /* + * The feature to segment the data on. + */ + @JsonProperty(value = "feature") + private String feature; + + /* + * Filters for only the specified values of the given segmented feature. + */ + @JsonProperty(value = "values") + private List values; + + /** Creates an instance of MonitoringDataSegment class. */ + public MonitoringDataSegment() { + } + + /** + * Get the feature property: The feature to segment the data on. + * + * @return the feature value. + */ + public String feature() { + return this.feature; + } + + /** + * Set the feature property: The feature to segment the data on. + * + * @param feature the feature value to set. + * @return the MonitoringDataSegment object itself. + */ + public MonitoringDataSegment withFeature(String feature) { + this.feature = feature; + return this; + } + + /** + * Get the values property: Filters for only the specified values of the given segmented feature. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Filters for only the specified values of the given segmented feature. + * + * @param values the values value to set. + * @return the MonitoringDataSegment object itself. + */ + public MonitoringDataSegment withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java new file mode 100644 index 0000000000000..0a1adce4b71be --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringFeatureDataType. */ +public final class MonitoringFeatureDataType extends ExpandableStringEnum { + /** Static value Numerical for MonitoringFeatureDataType. */ + public static final MonitoringFeatureDataType NUMERICAL = fromString("Numerical"); + + /** Static value Categorical for MonitoringFeatureDataType. */ + public static final MonitoringFeatureDataType CATEGORICAL = fromString("Categorical"); + + /** + * Creates a new instance of MonitoringFeatureDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringFeatureDataType() { + } + + /** + * Creates or finds a MonitoringFeatureDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringFeatureDataType. + */ + @JsonCreator + public static MonitoringFeatureDataType fromString(String name) { + return fromString(name, MonitoringFeatureDataType.class); + } + + /** + * Gets known MonitoringFeatureDataType values. + * + * @return known MonitoringFeatureDataType values. + */ + public static Collection values() { + return values(MonitoringFeatureDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java new file mode 100644 index 0000000000000..be6e3841178f5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MonitoringFeatureFilterBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "filterType", + defaultImpl = MonitoringFeatureFilterBase.class) +@JsonTypeName("MonitoringFeatureFilterBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AllFeatures", value = AllFeatures.class), + @JsonSubTypes.Type(name = "FeatureSubset", value = FeatureSubset.class), + @JsonSubTypes.Type(name = "TopNByAttribution", value = TopNFeaturesByAttribution.class) +}) +@Immutable +public class MonitoringFeatureFilterBase { + /** Creates an instance of MonitoringFeatureFilterBase class. */ + public MonitoringFeatureFilterBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java new file mode 100644 index 0000000000000..0172a563bca72 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringFeatureFilterType. */ +public final class MonitoringFeatureFilterType extends ExpandableStringEnum { + /** Static value AllFeatures for MonitoringFeatureFilterType. */ + public static final MonitoringFeatureFilterType ALL_FEATURES = fromString("AllFeatures"); + + /** Static value TopNByAttribution for MonitoringFeatureFilterType. */ + public static final MonitoringFeatureFilterType TOP_NBY_ATTRIBUTION = fromString("TopNByAttribution"); + + /** Static value FeatureSubset for MonitoringFeatureFilterType. */ + public static final MonitoringFeatureFilterType FEATURE_SUBSET = fromString("FeatureSubset"); + + /** + * Creates a new instance of MonitoringFeatureFilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringFeatureFilterType() { + } + + /** + * Creates or finds a MonitoringFeatureFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringFeatureFilterType. + */ + @JsonCreator + public static MonitoringFeatureFilterType fromString(String name) { + return fromString(name, MonitoringFeatureFilterType.class); + } + + /** + * Gets known MonitoringFeatureFilterType values. + * + * @return known MonitoringFeatureFilterType values. + */ + public static Collection values() { + return values(MonitoringFeatureFilterType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java new file mode 100644 index 0000000000000..352e33c1231a1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Monitoring input data base definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "inputDataType", + defaultImpl = MonitoringInputDataBase.class) +@JsonTypeName("MonitoringInputDataBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Fixed", value = FixedInputData.class), + @JsonSubTypes.Type(name = "Static", value = StaticInputData.class), + @JsonSubTypes.Type(name = "Trailing", value = TrailingInputData.class) +}) +@Fluent +public class MonitoringInputDataBase { + /* + * Mapping of column names to special uses. + */ + @JsonProperty(value = "columns") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map columns; + + /* + * The context metadata of the data source. + */ + @JsonProperty(value = "dataContext") + private String dataContext; + + /* + * [Required] Specifies the type of job. + */ + @JsonProperty(value = "jobInputType", required = true) + private JobInputType jobInputType; + + /* + * [Required] Input Asset URI. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** Creates an instance of MonitoringInputDataBase class. */ + public MonitoringInputDataBase() { + } + + /** + * Get the columns property: Mapping of column names to special uses. + * + * @return the columns value. + */ + public Map columns() { + return this.columns; + } + + /** + * Set the columns property: Mapping of column names to special uses. + * + * @param columns the columns value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withColumns(Map columns) { + this.columns = columns; + return this; + } + + /** + * Get the dataContext property: The context metadata of the data source. + * + * @return the dataContext value. + */ + public String dataContext() { + return this.dataContext; + } + + /** + * Set the dataContext property: The context metadata of the data source. + * + * @param dataContext the dataContext value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withDataContext(String dataContext) { + this.dataContext = dataContext; + return this; + } + + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + public JobInputType jobInputType() { + return this.jobInputType; + } + + /** + * Set the jobInputType property: [Required] Specifies the type of job. + * + * @param jobInputType the jobInputType value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withJobInputType(JobInputType jobInputType) { + this.jobInputType = jobInputType; + return this; + } + + /** + * Get the uri property: [Required] Input Asset URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: [Required] Input Asset URI. + * + * @param uri the uri value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobInputType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property jobInputType in model MonitoringInputDataBase")); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model MonitoringInputDataBase")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoringInputDataBase.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java new file mode 100644 index 0000000000000..d15ee876b8814 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Monitoring input data type enum. */ +public final class MonitoringInputDataType extends ExpandableStringEnum { + /** Static value Static for MonitoringInputDataType. */ + public static final MonitoringInputDataType STATIC = fromString("Static"); + + /** Static value Trailing for MonitoringInputDataType. */ + public static final MonitoringInputDataType TRAILING = fromString("Trailing"); + + /** Static value Fixed for MonitoringInputDataType. */ + public static final MonitoringInputDataType FIXED = fromString("Fixed"); + + /** + * Creates a new instance of MonitoringInputDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringInputDataType() { + } + + /** + * Creates or finds a MonitoringInputDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringInputDataType. + */ + @JsonCreator + public static MonitoringInputDataType fromString(String name) { + return fromString(name, MonitoringInputDataType.class); + } + + /** + * Gets known MonitoringInputDataType values. + * + * @return known MonitoringInputDataType values. + */ + public static Collection values() { + return values(MonitoringInputDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringModelType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringModelType.java new file mode 100644 index 0000000000000..cf02fc55a123a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringModelType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringModelType. */ +public final class MonitoringModelType extends ExpandableStringEnum { + /** Static value Classification for MonitoringModelType. */ + public static final MonitoringModelType CLASSIFICATION = fromString("Classification"); + + /** Static value Regression for MonitoringModelType. */ + public static final MonitoringModelType REGRESSION = fromString("Regression"); + + /** + * Creates a new instance of MonitoringModelType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringModelType() { + } + + /** + * Creates or finds a MonitoringModelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringModelType. + */ + @JsonCreator + public static MonitoringModelType fromString(String name) { + return fromString(name, MonitoringModelType.class); + } + + /** + * Gets known MonitoringModelType values. + * + * @return known MonitoringModelType values. + */ + public static Collection values() { + return values(MonitoringModelType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationMode.java new file mode 100644 index 0000000000000..c2b925c81f8ae --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringNotificationMode. */ +public final class MonitoringNotificationMode extends ExpandableStringEnum { + /** Static value Disabled for MonitoringNotificationMode. */ + public static final MonitoringNotificationMode DISABLED = fromString("Disabled"); + + /** Static value Enabled for MonitoringNotificationMode. */ + public static final MonitoringNotificationMode ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of MonitoringNotificationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringNotificationMode() { + } + + /** + * Creates or finds a MonitoringNotificationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringNotificationMode. + */ + @JsonCreator + public static MonitoringNotificationMode fromString(String name) { + return fromString(name, MonitoringNotificationMode.class); + } + + /** + * Gets known MonitoringNotificationMode values. + * + * @return known MonitoringNotificationMode values. + */ + public static Collection values() { + return values(MonitoringNotificationMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java new file mode 100644 index 0000000000000..8954bfb75fdef --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** The MonitoringSignalBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "signalType", + defaultImpl = MonitoringSignalBase.class) +@JsonTypeName("MonitoringSignalBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Custom", value = CustomMonitoringSignal.class), + @JsonSubTypes.Type(name = "DataDrift", value = DataDriftMonitoringSignal.class), + @JsonSubTypes.Type(name = "DataQuality", value = DataQualityMonitoringSignal.class), + @JsonSubTypes.Type(name = "FeatureAttributionDrift", value = FeatureAttributionDriftMonitoringSignal.class), + @JsonSubTypes.Type(name = "GenerationSafetyQuality", value = GenerationSafetyQualityMonitoringSignal.class), + @JsonSubTypes.Type(name = "GenerationTokenStatistics", value = GenerationTokenStatisticsSignal.class), + @JsonSubTypes.Type(name = "ModelPerformance", value = ModelPerformanceSignal.class), + @JsonSubTypes.Type(name = "PredictionDrift", value = PredictionDriftMonitoringSignal.class) +}) +@Fluent +public class MonitoringSignalBase { + /* + * The current notification mode for this signal. + */ + @JsonProperty(value = "mode") + private MonitoringNotificationMode mode; + + /* + * Property dictionary. Properties can be added, but not removed or altered. + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /** Creates an instance of MonitoringSignalBase class. */ + public MonitoringSignalBase() { + } + + /** + * Get the mode property: The current notification mode for this signal. + * + * @return the mode value. + */ + public MonitoringNotificationMode mode() { + return this.mode; + } + + /** + * Set the mode property: The current notification mode for this signal. + * + * @param mode the mode value to set. + * @return the MonitoringSignalBase object itself. + */ + public MonitoringSignalBase withMode(MonitoringNotificationMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the properties property: Property dictionary. Properties can be added, but not removed or altered. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Property dictionary. Properties can be added, but not removed or altered. + * + * @param properties the properties value to set. + * @return the MonitoringSignalBase object itself. + */ + public MonitoringSignalBase withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java new file mode 100644 index 0000000000000..da58a3f157cf4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringSignalType. */ +public final class MonitoringSignalType extends ExpandableStringEnum { + /** Static value DataDrift for MonitoringSignalType. */ + public static final MonitoringSignalType DATA_DRIFT = fromString("DataDrift"); + + /** Static value PredictionDrift for MonitoringSignalType. */ + public static final MonitoringSignalType PREDICTION_DRIFT = fromString("PredictionDrift"); + + /** Static value DataQuality for MonitoringSignalType. */ + public static final MonitoringSignalType DATA_QUALITY = fromString("DataQuality"); + + /** Static value FeatureAttributionDrift for MonitoringSignalType. */ + public static final MonitoringSignalType FEATURE_ATTRIBUTION_DRIFT = fromString("FeatureAttributionDrift"); + + /** Static value Custom for MonitoringSignalType. */ + public static final MonitoringSignalType CUSTOM = fromString("Custom"); + + /** Static value ModelPerformance for MonitoringSignalType. */ + public static final MonitoringSignalType MODEL_PERFORMANCE = fromString("ModelPerformance"); + + /** Static value GenerationSafetyQuality for MonitoringSignalType. */ + public static final MonitoringSignalType GENERATION_SAFETY_QUALITY = fromString("GenerationSafetyQuality"); + + /** Static value GenerationTokenStatistics for MonitoringSignalType. */ + public static final MonitoringSignalType GENERATION_TOKEN_STATISTICS = fromString("GenerationTokenStatistics"); + + /** + * Creates a new instance of MonitoringSignalType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringSignalType() { + } + + /** + * Creates or finds a MonitoringSignalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringSignalType. + */ + @JsonCreator + public static MonitoringSignalType fromString(String name) { + return fromString(name, MonitoringSignalType.class); + } + + /** + * Gets known MonitoringSignalType values. + * + * @return known MonitoringSignalType values. + */ + public static Collection values() { + return values(MonitoringSignalType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java new file mode 100644 index 0000000000000..623dc84bbe2ac --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring target definition. */ +@Fluent +public final class MonitoringTarget { + /* + * The ARM resource ID of either the deployment targeted by this monitor. + */ + @JsonProperty(value = "deploymentId") + private String deploymentId; + + /* + * The ARM resource ID of either the model targeted by this monitor. + */ + @JsonProperty(value = "modelId") + private String modelId; + + /* + * [Required] The machine learning task type of the model. + */ + @JsonProperty(value = "taskType", required = true) + private ModelTaskType taskType; + + /** Creates an instance of MonitoringTarget class. */ + public MonitoringTarget() { + } + + /** + * Get the deploymentId property: The ARM resource ID of either the deployment targeted by this monitor. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: The ARM resource ID of either the deployment targeted by this monitor. + * + * @param deploymentId the deploymentId value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the modelId property: The ARM resource ID of either the model targeted by this monitor. + * + * @return the modelId value. + */ + public String modelId() { + return this.modelId; + } + + /** + * Set the modelId property: The ARM resource ID of either the model targeted by this monitor. + * + * @param modelId the modelId value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withModelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * Get the taskType property: [Required] The machine learning task type of the model. + * + * @return the taskType value. + */ + public ModelTaskType taskType() { + return this.taskType; + } + + /** + * Set the taskType property: [Required] The machine learning task type of the model. + * + * @param taskType the taskType value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withTaskType(ModelTaskType taskType) { + this.taskType = taskType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (taskType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property taskType in model MonitoringTarget")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoringTarget.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java new file mode 100644 index 0000000000000..e10b6721a9890 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MonitoringThreshold model. */ +@Fluent +public final class MonitoringThreshold { + /* + * The threshold value. If null, the set default is dependent on the metric type. + */ + @JsonProperty(value = "value") + private Double value; + + /** Creates an instance of MonitoringThreshold class. */ + public MonitoringThreshold() { + } + + /** + * Get the value property: The threshold value. If null, the set default is dependent on the metric type. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Set the value property: The threshold value. If null, the set default is dependent on the metric type. + * + * @param value the value value to set. + * @return the MonitoringThreshold object itself. + */ + public MonitoringThreshold withValue(Double value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringWorkspaceConnection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringWorkspaceConnection.java new file mode 100644 index 0000000000000..c0062be4ca4bf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringWorkspaceConnection.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Monitoring workspace connection definition. */ +@Fluent +public final class MonitoringWorkspaceConnection { + /* + * The properties of a workspace service connection to store as environment variables in the submitted jobs. + * Key is workspace connection property path, name is environment variable key. + */ + @JsonProperty(value = "environmentVariables") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map environmentVariables; + + /* + * The properties of a workspace service connection to store as secrets in the submitted jobs. + * Key is workspace connection property path, name is secret key. + */ + @JsonProperty(value = "secrets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secrets; + + /** Creates an instance of MonitoringWorkspaceConnection class. */ + public MonitoringWorkspaceConnection() { + } + + /** + * Get the environmentVariables property: The properties of a workspace service connection to store as environment + * variables in the submitted jobs. Key is workspace connection property path, name is environment variable key. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: The properties of a workspace service connection to store as environment + * variables in the submitted jobs. Key is workspace connection property path, name is environment variable key. + * + * @param environmentVariables the environmentVariables value to set. + * @return the MonitoringWorkspaceConnection object itself. + */ + public MonitoringWorkspaceConnection withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the secrets property: The properties of a workspace service connection to store as secrets in the submitted + * jobs. Key is workspace connection property path, name is secret key. + * + * @return the secrets value. + */ + public Map secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The properties of a workspace service connection to store as secrets in the submitted + * jobs. Key is workspace connection property path, name is secret key. + * + * @param secrets the secrets value to set. + * @return the MonitoringWorkspaceConnection object itself. + */ + public MonitoringWorkspaceConnection withSecrets(Map secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MultiSelect.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MultiSelect.java new file mode 100644 index 0000000000000..54e5428e80234 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MultiSelect.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether multiSelect is enabled. */ +public final class MultiSelect extends ExpandableStringEnum { + /** Static value Enabled for MultiSelect. */ + public static final MultiSelect ENABLED = fromString("Enabled"); + + /** Static value Disabled for MultiSelect. */ + public static final MultiSelect DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MultiSelect value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MultiSelect() { + } + + /** + * Creates or finds a MultiSelect from its string representation. + * + * @param name a name to look for. + * @return the corresponding MultiSelect. + */ + @JsonCreator + public static MultiSelect fromString(String name) { + return fromString(name, MultiSelect.class); + } + + /** + * Gets known MultiSelect values. + * + * @return known MultiSelect values. + */ + public static Collection values() { + return values(MultiSelect.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpFixedParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpFixedParameters.java new file mode 100644 index 0000000000000..0831efb794b12 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpFixedParameters.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Fixed training parameters that won't be swept over during AutoML NLP training. */ +@Fluent +public final class NlpFixedParameters { + /* + * Number of steps to accumulate gradients over before running a backward pass. + */ + @JsonProperty(value = "gradientAccumulationSteps") + private Integer gradientAccumulationSteps; + + /* + * The learning rate for the training procedure. + */ + @JsonProperty(value = "learningRate") + private Float learningRate; + + /* + * The type of learning rate schedule to use during the training procedure. + */ + @JsonProperty(value = "learningRateScheduler") + private NlpLearningRateScheduler learningRateScheduler; + + /* + * The name of the model to train. + */ + @JsonProperty(value = "modelName") + private String modelName; + + /* + * Number of training epochs. + */ + @JsonProperty(value = "numberOfEpochs") + private Integer numberOfEpochs; + + /* + * The batch size for the training procedure. + */ + @JsonProperty(value = "trainingBatchSize") + private Integer trainingBatchSize; + + /* + * The batch size to be used during evaluation. + */ + @JsonProperty(value = "validationBatchSize") + private Integer validationBatchSize; + + /* + * The warmup ratio, used alongside LrSchedulerType. + */ + @JsonProperty(value = "warmupRatio") + private Float warmupRatio; + + /* + * The weight decay for the training procedure. + */ + @JsonProperty(value = "weightDecay") + private Float weightDecay; + + /** Creates an instance of NlpFixedParameters class. */ + public NlpFixedParameters() { + } + + /** + * Get the gradientAccumulationSteps property: Number of steps to accumulate gradients over before running a + * backward pass. + * + * @return the gradientAccumulationSteps value. + */ + public Integer gradientAccumulationSteps() { + return this.gradientAccumulationSteps; + } + + /** + * Set the gradientAccumulationSteps property: Number of steps to accumulate gradients over before running a + * backward pass. + * + * @param gradientAccumulationSteps the gradientAccumulationSteps value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withGradientAccumulationSteps(Integer gradientAccumulationSteps) { + this.gradientAccumulationSteps = gradientAccumulationSteps; + return this; + } + + /** + * Get the learningRate property: The learning rate for the training procedure. + * + * @return the learningRate value. + */ + public Float learningRate() { + return this.learningRate; + } + + /** + * Set the learningRate property: The learning rate for the training procedure. + * + * @param learningRate the learningRate value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withLearningRate(Float learningRate) { + this.learningRate = learningRate; + return this; + } + + /** + * Get the learningRateScheduler property: The type of learning rate schedule to use during the training procedure. + * + * @return the learningRateScheduler value. + */ + public NlpLearningRateScheduler learningRateScheduler() { + return this.learningRateScheduler; + } + + /** + * Set the learningRateScheduler property: The type of learning rate schedule to use during the training procedure. + * + * @param learningRateScheduler the learningRateScheduler value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withLearningRateScheduler(NlpLearningRateScheduler learningRateScheduler) { + this.learningRateScheduler = learningRateScheduler; + return this; + } + + /** + * Get the modelName property: The name of the model to train. + * + * @return the modelName value. + */ + public String modelName() { + return this.modelName; + } + + /** + * Set the modelName property: The name of the model to train. + * + * @param modelName the modelName value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withModelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get the numberOfEpochs property: Number of training epochs. + * + * @return the numberOfEpochs value. + */ + public Integer numberOfEpochs() { + return this.numberOfEpochs; + } + + /** + * Set the numberOfEpochs property: Number of training epochs. + * + * @param numberOfEpochs the numberOfEpochs value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withNumberOfEpochs(Integer numberOfEpochs) { + this.numberOfEpochs = numberOfEpochs; + return this; + } + + /** + * Get the trainingBatchSize property: The batch size for the training procedure. + * + * @return the trainingBatchSize value. + */ + public Integer trainingBatchSize() { + return this.trainingBatchSize; + } + + /** + * Set the trainingBatchSize property: The batch size for the training procedure. + * + * @param trainingBatchSize the trainingBatchSize value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withTrainingBatchSize(Integer trainingBatchSize) { + this.trainingBatchSize = trainingBatchSize; + return this; + } + + /** + * Get the validationBatchSize property: The batch size to be used during evaluation. + * + * @return the validationBatchSize value. + */ + public Integer validationBatchSize() { + return this.validationBatchSize; + } + + /** + * Set the validationBatchSize property: The batch size to be used during evaluation. + * + * @param validationBatchSize the validationBatchSize value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withValidationBatchSize(Integer validationBatchSize) { + this.validationBatchSize = validationBatchSize; + return this; + } + + /** + * Get the warmupRatio property: The warmup ratio, used alongside LrSchedulerType. + * + * @return the warmupRatio value. + */ + public Float warmupRatio() { + return this.warmupRatio; + } + + /** + * Set the warmupRatio property: The warmup ratio, used alongside LrSchedulerType. + * + * @param warmupRatio the warmupRatio value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withWarmupRatio(Float warmupRatio) { + this.warmupRatio = warmupRatio; + return this; + } + + /** + * Get the weightDecay property: The weight decay for the training procedure. + * + * @return the weightDecay value. + */ + public Float weightDecay() { + return this.weightDecay; + } + + /** + * Set the weightDecay property: The weight decay for the training procedure. + * + * @param weightDecay the weightDecay value to set. + * @return the NlpFixedParameters object itself. + */ + public NlpFixedParameters withWeightDecay(Float weightDecay) { + this.weightDecay = weightDecay; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpLearningRateScheduler.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpLearningRateScheduler.java new file mode 100644 index 0000000000000..fa6f48505cf1d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpLearningRateScheduler.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum of learning rate schedulers that aligns with those supported by HF. */ +public final class NlpLearningRateScheduler extends ExpandableStringEnum { + /** Static value None for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler NONE = fromString("None"); + + /** Static value Linear for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler LINEAR = fromString("Linear"); + + /** Static value Cosine for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler COSINE = fromString("Cosine"); + + /** Static value CosineWithRestarts for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler COSINE_WITH_RESTARTS = fromString("CosineWithRestarts"); + + /** Static value Polynomial for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler POLYNOMIAL = fromString("Polynomial"); + + /** Static value Constant for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler CONSTANT = fromString("Constant"); + + /** Static value ConstantWithWarmup for NlpLearningRateScheduler. */ + public static final NlpLearningRateScheduler CONSTANT_WITH_WARMUP = fromString("ConstantWithWarmup"); + + /** + * Creates a new instance of NlpLearningRateScheduler value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NlpLearningRateScheduler() { + } + + /** + * Creates or finds a NlpLearningRateScheduler from its string representation. + * + * @param name a name to look for. + * @return the corresponding NlpLearningRateScheduler. + */ + @JsonCreator + public static NlpLearningRateScheduler fromString(String name) { + return fromString(name, NlpLearningRateScheduler.class); + } + + /** + * Gets known NlpLearningRateScheduler values. + * + * @return known NlpLearningRateScheduler values. + */ + public static Collection values() { + return values(NlpLearningRateScheduler.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpParameterSubspace.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpParameterSubspace.java new file mode 100644 index 0000000000000..4eb747bc0be8b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpParameterSubspace.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stringified search spaces for each parameter. See below examples. */ +@Fluent +public final class NlpParameterSubspace { + /* + * Number of steps to accumulate gradients over before running a backward pass. + */ + @JsonProperty(value = "gradientAccumulationSteps") + private String gradientAccumulationSteps; + + /* + * The learning rate for the training procedure. + */ + @JsonProperty(value = "learningRate") + private String learningRate; + + /* + * The type of learning rate schedule to use during the training procedure. + */ + @JsonProperty(value = "learningRateScheduler") + private String learningRateScheduler; + + /* + * The name of the model to train. + */ + @JsonProperty(value = "modelName") + private String modelName; + + /* + * Number of training epochs. + */ + @JsonProperty(value = "numberOfEpochs") + private String numberOfEpochs; + + /* + * The batch size for the training procedure. + */ + @JsonProperty(value = "trainingBatchSize") + private String trainingBatchSize; + + /* + * The batch size to be used during evaluation. + */ + @JsonProperty(value = "validationBatchSize") + private String validationBatchSize; + + /* + * The warmup ratio, used alongside LrSchedulerType. + */ + @JsonProperty(value = "warmupRatio") + private String warmupRatio; + + /* + * The weight decay for the training procedure. + */ + @JsonProperty(value = "weightDecay") + private String weightDecay; + + /** Creates an instance of NlpParameterSubspace class. */ + public NlpParameterSubspace() { + } + + /** + * Get the gradientAccumulationSteps property: Number of steps to accumulate gradients over before running a + * backward pass. + * + * @return the gradientAccumulationSteps value. + */ + public String gradientAccumulationSteps() { + return this.gradientAccumulationSteps; + } + + /** + * Set the gradientAccumulationSteps property: Number of steps to accumulate gradients over before running a + * backward pass. + * + * @param gradientAccumulationSteps the gradientAccumulationSteps value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withGradientAccumulationSteps(String gradientAccumulationSteps) { + this.gradientAccumulationSteps = gradientAccumulationSteps; + return this; + } + + /** + * Get the learningRate property: The learning rate for the training procedure. + * + * @return the learningRate value. + */ + public String learningRate() { + return this.learningRate; + } + + /** + * Set the learningRate property: The learning rate for the training procedure. + * + * @param learningRate the learningRate value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withLearningRate(String learningRate) { + this.learningRate = learningRate; + return this; + } + + /** + * Get the learningRateScheduler property: The type of learning rate schedule to use during the training procedure. + * + * @return the learningRateScheduler value. + */ + public String learningRateScheduler() { + return this.learningRateScheduler; + } + + /** + * Set the learningRateScheduler property: The type of learning rate schedule to use during the training procedure. + * + * @param learningRateScheduler the learningRateScheduler value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withLearningRateScheduler(String learningRateScheduler) { + this.learningRateScheduler = learningRateScheduler; + return this; + } + + /** + * Get the modelName property: The name of the model to train. + * + * @return the modelName value. + */ + public String modelName() { + return this.modelName; + } + + /** + * Set the modelName property: The name of the model to train. + * + * @param modelName the modelName value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withModelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get the numberOfEpochs property: Number of training epochs. + * + * @return the numberOfEpochs value. + */ + public String numberOfEpochs() { + return this.numberOfEpochs; + } + + /** + * Set the numberOfEpochs property: Number of training epochs. + * + * @param numberOfEpochs the numberOfEpochs value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withNumberOfEpochs(String numberOfEpochs) { + this.numberOfEpochs = numberOfEpochs; + return this; + } + + /** + * Get the trainingBatchSize property: The batch size for the training procedure. + * + * @return the trainingBatchSize value. + */ + public String trainingBatchSize() { + return this.trainingBatchSize; + } + + /** + * Set the trainingBatchSize property: The batch size for the training procedure. + * + * @param trainingBatchSize the trainingBatchSize value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withTrainingBatchSize(String trainingBatchSize) { + this.trainingBatchSize = trainingBatchSize; + return this; + } + + /** + * Get the validationBatchSize property: The batch size to be used during evaluation. + * + * @return the validationBatchSize value. + */ + public String validationBatchSize() { + return this.validationBatchSize; + } + + /** + * Set the validationBatchSize property: The batch size to be used during evaluation. + * + * @param validationBatchSize the validationBatchSize value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withValidationBatchSize(String validationBatchSize) { + this.validationBatchSize = validationBatchSize; + return this; + } + + /** + * Get the warmupRatio property: The warmup ratio, used alongside LrSchedulerType. + * + * @return the warmupRatio value. + */ + public String warmupRatio() { + return this.warmupRatio; + } + + /** + * Set the warmupRatio property: The warmup ratio, used alongside LrSchedulerType. + * + * @param warmupRatio the warmupRatio value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withWarmupRatio(String warmupRatio) { + this.warmupRatio = warmupRatio; + return this; + } + + /** + * Get the weightDecay property: The weight decay for the training procedure. + * + * @return the weightDecay value. + */ + public String weightDecay() { + return this.weightDecay; + } + + /** + * Set the weightDecay property: The weight decay for the training procedure. + * + * @param weightDecay the weightDecay value to set. + * @return the NlpParameterSubspace object itself. + */ + public NlpParameterSubspace withWeightDecay(String weightDecay) { + this.weightDecay = weightDecay; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpSweepSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpSweepSettings.java new file mode 100644 index 0000000000000..abf3301555007 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpSweepSettings.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Model sweeping and hyperparameter tuning related settings. */ +@Fluent +public final class NlpSweepSettings { + /* + * Type of early termination policy for the sweeping job. + */ + @JsonProperty(value = "earlyTermination") + private EarlyTerminationPolicy earlyTermination; + + /* + * [Required] Type of sampling algorithm. + */ + @JsonProperty(value = "samplingAlgorithm", required = true) + private SamplingAlgorithmType samplingAlgorithm; + + /** Creates an instance of NlpSweepSettings class. */ + public NlpSweepSettings() { + } + + /** + * Get the earlyTermination property: Type of early termination policy for the sweeping job. + * + * @return the earlyTermination value. + */ + public EarlyTerminationPolicy earlyTermination() { + return this.earlyTermination; + } + + /** + * Set the earlyTermination property: Type of early termination policy for the sweeping job. + * + * @param earlyTermination the earlyTermination value to set. + * @return the NlpSweepSettings object itself. + */ + public NlpSweepSettings withEarlyTermination(EarlyTerminationPolicy earlyTermination) { + this.earlyTermination = earlyTermination; + return this; + } + + /** + * Get the samplingAlgorithm property: [Required] Type of sampling algorithm. + * + * @return the samplingAlgorithm value. + */ + public SamplingAlgorithmType samplingAlgorithm() { + return this.samplingAlgorithm; + } + + /** + * Set the samplingAlgorithm property: [Required] Type of sampling algorithm. + * + * @param samplingAlgorithm the samplingAlgorithm value to set. + * @return the NlpSweepSettings object itself. + */ + public NlpSweepSettings withSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithm) { + this.samplingAlgorithm = samplingAlgorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (earlyTermination() != null) { + earlyTermination().validate(); + } + if (samplingAlgorithm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property samplingAlgorithm in model NlpSweepSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NlpSweepSettings.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java index deab5558f7010..ea70c988c4089 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Abstract class for NLP related AutoML tasks. NLP - Natural Language Processing. */ @Fluent @@ -16,12 +17,30 @@ public class NlpVertical { @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private NlpFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private NlpSweepSettings sweepSettings; + /* * Validation data inputs. */ @@ -52,6 +71,26 @@ public NlpVertical withFeaturizationSettings(NlpVerticalFeaturizationSettings fe return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public NlpFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the NlpVertical object itself. + */ + public NlpVertical withFixedParameters(NlpFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -72,6 +111,48 @@ public NlpVertical withLimitSettings(NlpVerticalLimitSettings limitSettings) { return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the NlpVertical object itself. + */ + public NlpVertical withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public NlpSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the NlpVertical object itself. + */ + public NlpVertical withSweepSettings(NlpSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the validationData property: Validation data inputs. * @@ -101,9 +182,18 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (validationData() != null) { validationData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java index 82dddc5df409e..d0cd521cf01f5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java @@ -17,6 +17,12 @@ public final class NlpVerticalLimitSettings { @JsonProperty(value = "maxConcurrentTrials") private Integer maxConcurrentTrials; + /* + * Maximum nodes to use for the experiment. + */ + @JsonProperty(value = "maxNodes") + private Integer maxNodes; + /* * Number of AutoML iterations. */ @@ -29,6 +35,12 @@ public final class NlpVerticalLimitSettings { @JsonProperty(value = "timeout") private Duration timeout; + /* + * Timeout for individual HD trials. + */ + @JsonProperty(value = "trialTimeout") + private Duration trialTimeout; + /** Creates an instance of NlpVerticalLimitSettings class. */ public NlpVerticalLimitSettings() { } @@ -53,6 +65,26 @@ public NlpVerticalLimitSettings withMaxConcurrentTrials(Integer maxConcurrentTri return this; } + /** + * Get the maxNodes property: Maximum nodes to use for the experiment. + * + * @return the maxNodes value. + */ + public Integer maxNodes() { + return this.maxNodes; + } + + /** + * Set the maxNodes property: Maximum nodes to use for the experiment. + * + * @param maxNodes the maxNodes value to set. + * @return the NlpVerticalLimitSettings object itself. + */ + public NlpVerticalLimitSettings withMaxNodes(Integer maxNodes) { + this.maxNodes = maxNodes; + return this; + } + /** * Get the maxTrials property: Number of AutoML iterations. * @@ -93,6 +125,26 @@ public NlpVerticalLimitSettings withTimeout(Duration timeout) { return this; } + /** + * Get the trialTimeout property: Timeout for individual HD trials. + * + * @return the trialTimeout value. + */ + public Duration trialTimeout() { + return this.trialTimeout; + } + + /** + * Set the trialTimeout property: Timeout for individual HD trials. + * + * @param trialTimeout the trialTimeout value to set. + * @return the NlpVerticalLimitSettings object itself. + */ + public NlpVerticalLimitSettings withTrialTimeout(Duration trialTimeout) { + this.trialTimeout = trialTimeout; + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java new file mode 100644 index 0000000000000..7dda54e50f54f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Abstract Nodes definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "nodesValueType", + defaultImpl = Nodes.class) +@JsonTypeName("Nodes") +@JsonSubTypes({@JsonSubTypes.Type(name = "All", value = AllNodes.class)}) +@Immutable +public class Nodes { + /** Creates an instance of Nodes class. */ + public Nodes() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java new file mode 100644 index 0000000000000..4d0b99a287977 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The enumerated types for the nodes value. */ +public final class NodesValueType extends ExpandableStringEnum { + /** Static value All for NodesValueType. */ + public static final NodesValueType ALL = fromString("All"); + + /** Static value Custom for NodesValueType. */ + public static final NodesValueType CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of NodesValueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodesValueType() { + } + + /** + * Creates or finds a NodesValueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodesValueType. + */ + @JsonCreator + public static NodesValueType fromString(String name) { + return fromString(name, NodesValueType.class); + } + + /** + * Gets known NodesValueType values. + * + * @return known NodesValueType values. + */ + public static Collection values() { + return values(NodesValueType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java index 79af891099d09..b292022079886 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The NoneAuthTypeWorkspaceConnectionProperties model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -26,22 +27,22 @@ public NoneAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory /** {@inheritDoc} */ @Override - public NoneAuthTypeWorkspaceConnectionProperties withTarget(String target) { - super.withTarget(target); + public NoneAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); return this; } /** {@inheritDoc} */ @Override - public NoneAuthTypeWorkspaceConnectionProperties withValue(String value) { - super.withValue(value); + public NoneAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); return this; } /** {@inheritDoc} */ @Override - public NoneAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { - super.withValueFormat(valueFormat); + public NoneAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java index 4e28342a32c7d..ad77458b4e48a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java @@ -9,46 +9,39 @@ /** An immutable client-side representation of NotebookAccessTokenResult. */ public interface NotebookAccessTokenResult { /** - * Gets the notebookResourceId property: The notebookResourceId property. - * - * @return the notebookResourceId value. - */ - String notebookResourceId(); - - /** - * Gets the hostname property: The hostName property. + * Gets the accessToken property: The accessToken property. * - * @return the hostname value. + * @return the accessToken value. */ - String hostname(); + String accessToken(); /** - * Gets the publicDns property: The publicDns property. + * Gets the expiresIn property: The expiresIn property. * - * @return the publicDns value. + * @return the expiresIn value. */ - String publicDns(); + Integer expiresIn(); /** - * Gets the accessToken property: The accessToken property. + * Gets the hostname property: The hostName property. * - * @return the accessToken value. + * @return the hostname value. */ - String accessToken(); + String hostname(); /** - * Gets the tokenType property: The tokenType property. + * Gets the notebookResourceId property: The notebookResourceId property. * - * @return the tokenType value. + * @return the notebookResourceId value. */ - String tokenType(); + String notebookResourceId(); /** - * Gets the expiresIn property: The expiresIn property. + * Gets the publicDns property: The publicDns property. * - * @return the expiresIn value. + * @return the publicDns value. */ - Integer expiresIn(); + String publicDns(); /** * Gets the refreshToken property: The refreshToken property. @@ -64,6 +57,13 @@ public interface NotebookAccessTokenResult { */ String scope(); + /** + * Gets the tokenType property: The tokenType property. + * + * @return the tokenType value. + */ + String tokenType(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner object. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java index f8aa5bb01e786..17c64d3489a08 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java @@ -16,11 +16,11 @@ public interface NotebookResourceInfo { String fqdn(); /** - * Gets the resourceId property: the data plane resourceId that used to initialize notebook component. + * Gets the isPrivateLinkEnabled property: The isPrivateLinkEnabled property. * - * @return the resourceId value. + * @return the isPrivateLinkEnabled value. */ - String resourceId(); + Boolean isPrivateLinkEnabled(); /** * Gets the notebookPreparationError property: The error that occurs when preparing notebook. @@ -29,6 +29,13 @@ public interface NotebookResourceInfo { */ NotebookPreparationError notebookPreparationError(); + /** + * Gets the resourceId property: the data plane resourceId that used to initialize notebook component. + * + * @return the resourceId value. + */ + String resourceId(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner object. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java new file mode 100644 index 0000000000000..96478b484d54e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Configuration for notification. */ +@Fluent +public final class NotificationSetting { + /* + * Send email notification to user on specified notification type + */ + @JsonProperty(value = "emailOn") + private List emailOn; + + /* + * This is the email recipient list which has a limitation of 499 characters in total concat with comma separator + */ + @JsonProperty(value = "emails") + private List emails; + + /* + * Send webhook callback to a service. Key is a user-provided name for the webhook. + */ + @JsonProperty(value = "webhooks") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map webhooks; + + /** Creates an instance of NotificationSetting class. */ + public NotificationSetting() { + } + + /** + * Get the emailOn property: Send email notification to user on specified notification type. + * + * @return the emailOn value. + */ + public List emailOn() { + return this.emailOn; + } + + /** + * Set the emailOn property: Send email notification to user on specified notification type. + * + * @param emailOn the emailOn value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withEmailOn(List emailOn) { + this.emailOn = emailOn; + return this; + } + + /** + * Get the emails property: This is the email recipient list which has a limitation of 499 characters in total + * concat with comma separator. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: This is the email recipient list which has a limitation of 499 characters in total + * concat with comma separator. + * + * @param emails the emails value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Get the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @return the webhooks value. + */ + public Map webhooks() { + return this.webhooks; + } + + /** + * Set the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @param webhooks the webhooks value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withWebhooks(Map webhooks) { + this.webhooks = webhooks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webhooks() != null) { + webhooks() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java new file mode 100644 index 0000000000000..354f6b6a9994d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NumericalDataDriftMetric. */ +public final class NumericalDataDriftMetric extends ExpandableStringEnum { + /** Static value JensenShannonDistance for NumericalDataDriftMetric. */ + public static final NumericalDataDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** Static value PopulationStabilityIndex for NumericalDataDriftMetric. */ + public static final NumericalDataDriftMetric POPULATION_STABILITY_INDEX = fromString("PopulationStabilityIndex"); + + /** Static value NormalizedWassersteinDistance for NumericalDataDriftMetric. */ + public static final NumericalDataDriftMetric NORMALIZED_WASSERSTEIN_DISTANCE = + fromString("NormalizedWassersteinDistance"); + + /** Static value TwoSampleKolmogorovSmirnovTest for NumericalDataDriftMetric. */ + public static final NumericalDataDriftMetric TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = + fromString("TwoSampleKolmogorovSmirnovTest"); + + /** + * Creates a new instance of NumericalDataDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalDataDriftMetric() { + } + + /** + * Creates or finds a NumericalDataDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalDataDriftMetric. + */ + @JsonCreator + public static NumericalDataDriftMetric fromString(String name) { + return fromString(name, NumericalDataDriftMetric.class); + } + + /** + * Gets known NumericalDataDriftMetric values. + * + * @return known NumericalDataDriftMetric values. + */ + public static Collection values() { + return values(NumericalDataDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java new file mode 100644 index 0000000000000..be451bfa636cf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The NumericalDataDriftMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Numerical") +@Fluent +public final class NumericalDataDriftMetricThreshold extends DataDriftMetricThresholdBase { + /* + * [Required] The numerical data drift metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private NumericalDataDriftMetric metric; + + /** Creates an instance of NumericalDataDriftMetricThreshold class. */ + public NumericalDataDriftMetricThreshold() { + } + + /** + * Get the metric property: [Required] The numerical data drift metric to calculate. + * + * @return the metric value. + */ + public NumericalDataDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical data drift metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalDataDriftMetricThreshold object itself. + */ + public NumericalDataDriftMetricThreshold withMetric(NumericalDataDriftMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public NumericalDataDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model NumericalDataDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalDataDriftMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java new file mode 100644 index 0000000000000..ea729dc12c419 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NumericalDataQualityMetric. */ +public final class NumericalDataQualityMetric extends ExpandableStringEnum { + /** Static value NullValueRate for NumericalDataQualityMetric. */ + public static final NumericalDataQualityMetric NULL_VALUE_RATE = fromString("NullValueRate"); + + /** Static value DataTypeErrorRate for NumericalDataQualityMetric. */ + public static final NumericalDataQualityMetric DATA_TYPE_ERROR_RATE = fromString("DataTypeErrorRate"); + + /** Static value OutOfBoundsRate for NumericalDataQualityMetric. */ + public static final NumericalDataQualityMetric OUT_OF_BOUNDS_RATE = fromString("OutOfBoundsRate"); + + /** + * Creates a new instance of NumericalDataQualityMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalDataQualityMetric() { + } + + /** + * Creates or finds a NumericalDataQualityMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalDataQualityMetric. + */ + @JsonCreator + public static NumericalDataQualityMetric fromString(String name) { + return fromString(name, NumericalDataQualityMetric.class); + } + + /** + * Gets known NumericalDataQualityMetric values. + * + * @return known NumericalDataQualityMetric values. + */ + public static Collection values() { + return values(NumericalDataQualityMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java new file mode 100644 index 0000000000000..ccd859d7531cd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The NumericalDataQualityMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Numerical") +@Fluent +public final class NumericalDataQualityMetricThreshold extends DataQualityMetricThresholdBase { + /* + * [Required] The numerical data quality metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private NumericalDataQualityMetric metric; + + /** Creates an instance of NumericalDataQualityMetricThreshold class. */ + public NumericalDataQualityMetricThreshold() { + } + + /** + * Get the metric property: [Required] The numerical data quality metric to calculate. + * + * @return the metric value. + */ + public NumericalDataQualityMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical data quality metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalDataQualityMetricThreshold object itself. + */ + public NumericalDataQualityMetricThreshold withMetric(NumericalDataQualityMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public NumericalDataQualityMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model NumericalDataQualityMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalDataQualityMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java new file mode 100644 index 0000000000000..a7e127e0020ee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NumericalPredictionDriftMetric. */ +public final class NumericalPredictionDriftMetric extends ExpandableStringEnum { + /** Static value JensenShannonDistance for NumericalPredictionDriftMetric. */ + public static final NumericalPredictionDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** Static value PopulationStabilityIndex for NumericalPredictionDriftMetric. */ + public static final NumericalPredictionDriftMetric POPULATION_STABILITY_INDEX = + fromString("PopulationStabilityIndex"); + + /** Static value NormalizedWassersteinDistance for NumericalPredictionDriftMetric. */ + public static final NumericalPredictionDriftMetric NORMALIZED_WASSERSTEIN_DISTANCE = + fromString("NormalizedWassersteinDistance"); + + /** Static value TwoSampleKolmogorovSmirnovTest for NumericalPredictionDriftMetric. */ + public static final NumericalPredictionDriftMetric TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = + fromString("TwoSampleKolmogorovSmirnovTest"); + + /** + * Creates a new instance of NumericalPredictionDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalPredictionDriftMetric() { + } + + /** + * Creates or finds a NumericalPredictionDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalPredictionDriftMetric. + */ + @JsonCreator + public static NumericalPredictionDriftMetric fromString(String name) { + return fromString(name, NumericalPredictionDriftMetric.class); + } + + /** + * Gets known NumericalPredictionDriftMetric values. + * + * @return known NumericalPredictionDriftMetric values. + */ + public static Collection values() { + return values(NumericalPredictionDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java new file mode 100644 index 0000000000000..915731fd0dbd1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The NumericalPredictionDriftMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") +@JsonTypeName("Numerical") +@Fluent +public final class NumericalPredictionDriftMetricThreshold extends PredictionDriftMetricThresholdBase { + /* + * [Required] The numerical prediction drift metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private NumericalPredictionDriftMetric metric; + + /** Creates an instance of NumericalPredictionDriftMetricThreshold class. */ + public NumericalPredictionDriftMetricThreshold() { + } + + /** + * Get the metric property: [Required] The numerical prediction drift metric to calculate. + * + * @return the metric value. + */ + public NumericalPredictionDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical prediction drift metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalPredictionDriftMetricThreshold object itself. + */ + public NumericalPredictionDriftMetricThreshold withMetric(NumericalPredictionDriftMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public NumericalPredictionDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model NumericalPredictionDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalPredictionDriftMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java new file mode 100644 index 0000000000000..8c84ba60d074f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** OneLake artifact (data source) configuration. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "artifactType", + defaultImpl = OneLakeArtifact.class) +@JsonTypeName("OneLakeArtifact") +@JsonSubTypes({@JsonSubTypes.Type(name = "LakeHouse", value = LakeHouseArtifact.class)}) +@Fluent +public class OneLakeArtifact { + /* + * [Required] OneLake artifact name + */ + @JsonProperty(value = "artifactName", required = true) + private String artifactName; + + /** Creates an instance of OneLakeArtifact class. */ + public OneLakeArtifact() { + } + + /** + * Get the artifactName property: [Required] OneLake artifact name. + * + * @return the artifactName value. + */ + public String artifactName() { + return this.artifactName; + } + + /** + * Set the artifactName property: [Required] OneLake artifact name. + * + * @param artifactName the artifactName value to set. + * @return the OneLakeArtifact object itself. + */ + public OneLakeArtifact withArtifactName(String artifactName) { + this.artifactName = artifactName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifactName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property artifactName in model OneLakeArtifact")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OneLakeArtifact.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java new file mode 100644 index 0000000000000..9bf8dd352ea3a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine OneLake artifact type. */ +public final class OneLakeArtifactType extends ExpandableStringEnum { + /** Static value LakeHouse for OneLakeArtifactType. */ + public static final OneLakeArtifactType LAKE_HOUSE = fromString("LakeHouse"); + + /** + * Creates a new instance of OneLakeArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OneLakeArtifactType() { + } + + /** + * Creates or finds a OneLakeArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OneLakeArtifactType. + */ + @JsonCreator + public static OneLakeArtifactType fromString(String name) { + return fromString(name, OneLakeArtifactType.class); + } + + /** + * Gets known OneLakeArtifactType values. + * + * @return known OneLakeArtifactType values. + */ + public static Collection values() { + return values(OneLakeArtifactType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java new file mode 100644 index 0000000000000..93aa80149554c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** OneLake (Trident) datastore configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") +@JsonTypeName("OneLake") +@Fluent +public final class OneLakeDatastore extends DatastoreProperties { + /* + * [Required] OneLake artifact backing the datastore. + */ + @JsonProperty(value = "artifact", required = true) + private OneLakeArtifact artifact; + + /* + * OneLake endpoint to use for the datastore. + */ + @JsonProperty(value = "endpoint") + private String endpoint; + + /* + * [Required] OneLake workspace name. + */ + @JsonProperty(value = "oneLakeWorkspaceName", required = true) + private String oneLakeWorkspaceName; + + /* + * Indicates which identity to use to authenticate service data access to customer's storage. + */ + @JsonProperty(value = "serviceDataAccessAuthIdentity") + private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; + + /** Creates an instance of OneLakeDatastore class. */ + public OneLakeDatastore() { + } + + /** + * Get the artifact property: [Required] OneLake artifact backing the datastore. + * + * @return the artifact value. + */ + public OneLakeArtifact artifact() { + return this.artifact; + } + + /** + * Set the artifact property: [Required] OneLake artifact backing the datastore. + * + * @param artifact the artifact value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withArtifact(OneLakeArtifact artifact) { + this.artifact = artifact; + return this; + } + + /** + * Get the endpoint property: OneLake endpoint to use for the datastore. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: OneLake endpoint to use for the datastore. + * + * @param endpoint the endpoint value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the oneLakeWorkspaceName property: [Required] OneLake workspace name. + * + * @return the oneLakeWorkspaceName value. + */ + public String oneLakeWorkspaceName() { + return this.oneLakeWorkspaceName; + } + + /** + * Set the oneLakeWorkspaceName property: [Required] OneLake workspace name. + * + * @param oneLakeWorkspaceName the oneLakeWorkspaceName value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withOneLakeWorkspaceName(String oneLakeWorkspaceName) { + this.oneLakeWorkspaceName = oneLakeWorkspaceName; + return this; + } + + /** + * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data + * access to customer's storage. + * + * @return the serviceDataAccessAuthIdentity value. + */ + public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { + return this.serviceDataAccessAuthIdentity; + } + + /** + * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data + * access to customer's storage. + * + * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withServiceDataAccessAuthIdentity( + ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; + return this; + } + + /** {@inheritDoc} */ + @Override + public OneLakeDatastore withCredentials(DatastoreCredentials credentials) { + super.withCredentials(credentials); + return this; + } + + /** {@inheritDoc} */ + @Override + public OneLakeDatastore withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public OneLakeDatastore withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public OneLakeDatastore withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public OneLakeDatastore withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifact() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property artifact in model OneLakeDatastore")); + } else { + artifact().validate(); + } + if (oneLakeWorkspaceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property oneLakeWorkspaceName in model OneLakeDatastore")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OneLakeDatastore.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java index 2a4d9145dae6e..7b52e4f92bf5c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java @@ -120,11 +120,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The OnlineDeployment definition stages. */ interface DefinitionStages { /** The first stage of the OnlineDeployment definition. */ interface Blank extends WithLocation { } + /** The stage of the OnlineDeployment definition allowing to specify location. */ interface WithLocation { /** @@ -143,6 +145,7 @@ interface WithLocation { */ WithParentResource withRegion(String location); } + /** The stage of the OnlineDeployment definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -156,6 +159,7 @@ interface WithParentResource { WithProperties withExistingOnlineEndpoint( String resourceGroupName, String workspaceName, String endpointName); } + /** The stage of the OnlineDeployment definition allowing to specify properties. */ interface WithProperties { /** @@ -166,6 +170,7 @@ interface WithProperties { */ WithCreate withProperties(OnlineDeploymentProperties properties); } + /** * The stage of the OnlineDeployment definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -190,6 +195,7 @@ interface WithCreate */ OnlineDeployment create(Context context); } + /** The stage of the OnlineDeployment definition allowing to specify tags. */ interface WithTags { /** @@ -200,6 +206,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the OnlineDeployment definition allowing to specify identity. */ interface WithIdentity { /** @@ -211,6 +218,7 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the OnlineDeployment definition allowing to specify kind. */ interface WithKind { /** @@ -223,6 +231,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the OnlineDeployment definition allowing to specify sku. */ interface WithSku { /** @@ -234,6 +243,7 @@ interface WithSku { WithCreate withSku(Sku sku); } } + /** * Begins update for the OnlineDeployment resource. * @@ -258,6 +268,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { */ OnlineDeployment apply(Context context); } + /** The OnlineDeployment update stages. */ interface UpdateStages { /** The stage of the OnlineDeployment update allowing to specify tags. */ @@ -270,6 +281,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the OnlineDeployment update allowing to specify sku. */ interface WithSku { /** @@ -281,6 +293,7 @@ interface WithSku { Update withSku(PartialSku sku); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java index fff47cc6a83f4..27debce73373b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java @@ -30,6 +30,12 @@ public class OnlineDeploymentProperties extends EndpointDeploymentPropertiesBase @JsonProperty(value = "appInsightsEnabled") private Boolean appInsightsEnabled; + /* + * The mdc configuration, we disable mdc when it's null. + */ + @JsonProperty(value = "dataCollector") + private DataCollector dataCollector; + /* * If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. */ @@ -112,6 +118,26 @@ public OnlineDeploymentProperties withAppInsightsEnabled(Boolean appInsightsEnab return this; } + /** + * Get the dataCollector property: The mdc configuration, we disable mdc when it's null. + * + * @return the dataCollector value. + */ + public DataCollector dataCollector() { + return this.dataCollector; + } + + /** + * Set the dataCollector property: The mdc configuration, we disable mdc when it's null. + * + * @param dataCollector the dataCollector value to set. + * @return the OnlineDeploymentProperties object itself. + */ + public OnlineDeploymentProperties withDataCollector(DataCollector dataCollector) { + this.dataCollector = dataCollector; + return this; + } + /** * Get the egressPublicNetworkAccess property: If Enabled, allow egress public network access. If Disabled, this * will create secure egress. Default: Enabled. @@ -333,6 +359,9 @@ public OnlineDeploymentProperties withProperties(Map properties) @Override public void validate() { super.validate(); + if (dataCollector() != null) { + dataCollector().validate(); + } if (livenessProbe() != null) { livenessProbe().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java index 45e3b1948649e..2c29a19ad5db5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java @@ -120,11 +120,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The OnlineEndpoint definition stages. */ interface DefinitionStages { /** The first stage of the OnlineEndpoint definition. */ interface Blank extends WithLocation { } + /** The stage of the OnlineEndpoint definition allowing to specify location. */ interface WithLocation { /** @@ -143,6 +145,7 @@ interface WithLocation { */ WithParentResource withRegion(String location); } + /** The stage of the OnlineEndpoint definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -154,6 +157,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the OnlineEndpoint definition allowing to specify properties. */ interface WithProperties { /** @@ -164,6 +168,7 @@ interface WithProperties { */ WithCreate withProperties(OnlineEndpointProperties properties); } + /** * The stage of the OnlineEndpoint definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -188,6 +193,7 @@ interface WithCreate */ OnlineEndpoint create(Context context); } + /** The stage of the OnlineEndpoint definition allowing to specify tags. */ interface WithTags { /** @@ -198,6 +204,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the OnlineEndpoint definition allowing to specify identity. */ interface WithIdentity { /** @@ -209,6 +216,7 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the OnlineEndpoint definition allowing to specify kind. */ interface WithKind { /** @@ -221,6 +229,7 @@ interface WithKind { */ WithCreate withKind(String kind); } + /** The stage of the OnlineEndpoint definition allowing to specify sku. */ interface WithSku { /** @@ -232,6 +241,7 @@ interface WithSku { WithCreate withSku(Sku sku); } } + /** * Begins update for the OnlineEndpoint resource. * @@ -256,6 +266,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { */ OnlineEndpoint apply(Context context); } + /** The OnlineEndpoint update stages. */ interface UpdateStages { /** The stage of the OnlineEndpoint update allowing to specify tags. */ @@ -268,6 +279,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the OnlineEndpoint update allowing to specify identity. */ interface WithIdentity { /** @@ -280,6 +292,7 @@ interface WithIdentity { Update withIdentity(PartialManagedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. * @@ -337,7 +350,7 @@ interface WithIdentity { void regenerateKeys(RegenerateEndpointKeysRequest body, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -348,7 +361,7 @@ interface WithIdentity { Response getTokenWithResponse(Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java index ae7b1c483c58f..f7896495dfc99 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java @@ -21,6 +21,14 @@ public final class OnlineEndpointProperties extends EndpointPropertiesBaseInner @JsonProperty(value = "compute") private String compute; + /* + * Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to + * sum to utmost 50. + */ + @JsonProperty(value = "mirrorTraffic") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map mirrorTraffic; + /* * Provisioning state for the endpoint. */ @@ -64,6 +72,28 @@ public OnlineEndpointProperties withCompute(String compute) { return this; } + /** + * Get the mirrorTraffic property: Percentage of traffic to be mirrored to each deployment without using returned + * scoring. Traffic values need to sum to utmost 50. + * + * @return the mirrorTraffic value. + */ + public Map mirrorTraffic() { + return this.mirrorTraffic; + } + + /** + * Set the mirrorTraffic property: Percentage of traffic to be mirrored to each deployment without using returned + * scoring. Traffic values need to sum to utmost 50. + * + * @param mirrorTraffic the mirrorTraffic value to set. + * @return the OnlineEndpointProperties object itself. + */ + public OnlineEndpointProperties withMirrorTraffic(Map mirrorTraffic) { + this.mirrorTraffic = mirrorTraffic; + return this; + } + /** * Get the provisioningState property: Provisioning state for the endpoint. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java index 44e3dd0a80699..eb708d8ce2180 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java @@ -169,7 +169,7 @@ void regenerateKeys( Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -184,7 +184,7 @@ Response getTokenWithResponse( String resourceGroupName, String workspaceName, String endpointName, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineInferenceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineInferenceConfiguration.java new file mode 100644 index 0000000000000..bccfe74afd4f9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineInferenceConfiguration.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Online inference configuration options. */ +@Fluent +public final class OnlineInferenceConfiguration { + /* + * Additional configurations + */ + @JsonProperty(value = "configurations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map configurations; + + /* + * Entry script or command to invoke. + */ + @JsonProperty(value = "entryScript") + private String entryScript; + + /* + * The route to check the liveness of the inference server container. + */ + @JsonProperty(value = "livenessRoute") + private Route livenessRoute; + + /* + * The route to check the readiness of the inference server container. + */ + @JsonProperty(value = "readinessRoute") + private Route readinessRoute; + + /* + * The port to send the scoring requests to, within the inference server container. + */ + @JsonProperty(value = "scoringRoute") + private Route scoringRoute; + + /** Creates an instance of OnlineInferenceConfiguration class. */ + public OnlineInferenceConfiguration() { + } + + /** + * Get the configurations property: Additional configurations. + * + * @return the configurations value. + */ + public Map configurations() { + return this.configurations; + } + + /** + * Set the configurations property: Additional configurations. + * + * @param configurations the configurations value to set. + * @return the OnlineInferenceConfiguration object itself. + */ + public OnlineInferenceConfiguration withConfigurations(Map configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the entryScript property: Entry script or command to invoke. + * + * @return the entryScript value. + */ + public String entryScript() { + return this.entryScript; + } + + /** + * Set the entryScript property: Entry script or command to invoke. + * + * @param entryScript the entryScript value to set. + * @return the OnlineInferenceConfiguration object itself. + */ + public OnlineInferenceConfiguration withEntryScript(String entryScript) { + this.entryScript = entryScript; + return this; + } + + /** + * Get the livenessRoute property: The route to check the liveness of the inference server container. + * + * @return the livenessRoute value. + */ + public Route livenessRoute() { + return this.livenessRoute; + } + + /** + * Set the livenessRoute property: The route to check the liveness of the inference server container. + * + * @param livenessRoute the livenessRoute value to set. + * @return the OnlineInferenceConfiguration object itself. + */ + public OnlineInferenceConfiguration withLivenessRoute(Route livenessRoute) { + this.livenessRoute = livenessRoute; + return this; + } + + /** + * Get the readinessRoute property: The route to check the readiness of the inference server container. + * + * @return the readinessRoute value. + */ + public Route readinessRoute() { + return this.readinessRoute; + } + + /** + * Set the readinessRoute property: The route to check the readiness of the inference server container. + * + * @param readinessRoute the readinessRoute value to set. + * @return the OnlineInferenceConfiguration object itself. + */ + public OnlineInferenceConfiguration withReadinessRoute(Route readinessRoute) { + this.readinessRoute = readinessRoute; + return this; + } + + /** + * Get the scoringRoute property: The port to send the scoring requests to, within the inference server container. + * + * @return the scoringRoute value. + */ + public Route scoringRoute() { + return this.scoringRoute; + } + + /** + * Set the scoringRoute property: The port to send the scoring requests to, within the inference server container. + * + * @param scoringRoute the scoringRoute value to set. + * @return the OnlineInferenceConfiguration object itself. + */ + public OnlineInferenceConfiguration withScoringRoute(Route scoringRoute) { + this.scoringRoute = scoringRoute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (livenessRoute() != null) { + livenessRoute().validate(); + } + if (readinessRoute() != null) { + readinessRoute().validate(); + } + if (scoringRoute() != null) { + scoringRoute().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java new file mode 100644 index 0000000000000..58ede1b9764ce --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display name of operation. */ +@Fluent +public final class OperationDisplay { + /* + * Gets or sets the description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Gets or sets the operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Gets or sets the resource provider name: + * Microsoft.MachineLearningExperimentation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Gets or sets the resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the description property: Gets or sets the description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets the description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the operation property: Gets or sets the operation that users can perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Gets or sets the operation that users can perform. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the provider property: Gets or sets the resource provider name: Microsoft.MachineLearningExperimentation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Gets or sets the resource provider name: Microsoft.MachineLearningExperimentation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Gets or sets the resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Gets or sets the resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java index 1b428d2aeefde..b7fcd69c0da4e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java @@ -22,6 +22,9 @@ public final class OperationName extends ExpandableStringEnum { /** Static value Restart for OperationName. */ public static final OperationName RESTART = fromString("Restart"); + /** Static value Resize for OperationName. */ + public static final OperationName RESIZE = fromString("Resize"); + /** Static value Reimage for OperationName. */ public static final OperationName REIMAGE = fromString("Reimage"); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java index af28ce807caaf..973d4fc623039 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java @@ -28,6 +28,9 @@ public final class OperationStatus extends ExpandableStringEnum /** Static value RestartFailed for OperationStatus. */ public static final OperationStatus RESTART_FAILED = fromString("RestartFailed"); + /** Static value ResizeFailed for OperationStatus. */ + public static final OperationStatus RESIZE_FAILED = fromString("ResizeFailed"); + /** Static value ReimageFailed for OperationStatus. */ public static final OperationStatus REIMAGE_FAILED = fromString("ReimageFailed"); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsPatchingStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsPatchingStatus.java new file mode 100644 index 0000000000000..0ef8e59323f66 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsPatchingStatus.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Returns metadata about the os patching. */ +@Fluent +public final class OsPatchingStatus { + /* + * The os patching status. + */ + @JsonProperty(value = "patchStatus") + private String patchStatus; + + /* + * Time of the latest os patching. + */ + @JsonProperty(value = "latestPatchTime") + private String latestPatchTime; + + /* + * Specifies whether this compute instance is pending for reboot to finish os patching. + */ + @JsonProperty(value = "rebootPending") + private Boolean rebootPending; + + /* + * Time of scheduled reboot. + */ + @JsonProperty(value = "scheduledRebootTime") + private String scheduledRebootTime; + + /** Creates an instance of OsPatchingStatus class. */ + public OsPatchingStatus() { + } + + /** + * Get the patchStatus property: The os patching status. + * + * @return the patchStatus value. + */ + public String patchStatus() { + return this.patchStatus; + } + + /** + * Set the patchStatus property: The os patching status. + * + * @param patchStatus the patchStatus value to set. + * @return the OsPatchingStatus object itself. + */ + public OsPatchingStatus withPatchStatus(String patchStatus) { + this.patchStatus = patchStatus; + return this; + } + + /** + * Get the latestPatchTime property: Time of the latest os patching. + * + * @return the latestPatchTime value. + */ + public String latestPatchTime() { + return this.latestPatchTime; + } + + /** + * Set the latestPatchTime property: Time of the latest os patching. + * + * @param latestPatchTime the latestPatchTime value to set. + * @return the OsPatchingStatus object itself. + */ + public OsPatchingStatus withLatestPatchTime(String latestPatchTime) { + this.latestPatchTime = latestPatchTime; + return this; + } + + /** + * Get the rebootPending property: Specifies whether this compute instance is pending for reboot to finish os + * patching. + * + * @return the rebootPending value. + */ + public Boolean rebootPending() { + return this.rebootPending; + } + + /** + * Set the rebootPending property: Specifies whether this compute instance is pending for reboot to finish os + * patching. + * + * @param rebootPending the rebootPending value to set. + * @return the OsPatchingStatus object itself. + */ + public OsPatchingStatus withRebootPending(Boolean rebootPending) { + this.rebootPending = rebootPending; + return this; + } + + /** + * Get the scheduledRebootTime property: Time of scheduled reboot. + * + * @return the scheduledRebootTime value. + */ + public String scheduledRebootTime() { + return this.scheduledRebootTime; + } + + /** + * Set the scheduledRebootTime property: Time of scheduled reboot. + * + * @param scheduledRebootTime the scheduledRebootTime value to set. + * @return the OsPatchingStatus object itself. + */ + public OsPatchingStatus withScheduledRebootTime(String scheduledRebootTime) { + this.scheduledRebootTime = scheduledRebootTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java new file mode 100644 index 0000000000000..5b6dd2be08fe3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Outbound Rule for the managed network of a machine learning workspace. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = OutboundRule.class) +@JsonTypeName("OutboundRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FQDN", value = FqdnOutboundRule.class), + @JsonSubTypes.Type(name = "PrivateEndpoint", value = PrivateEndpointOutboundRule.class), + @JsonSubTypes.Type(name = "ServiceTag", value = ServiceTagOutboundRule.class) +}) +@Fluent +public class OutboundRule { + /* + * Category of a managed network Outbound Rule of a machine learning workspace. + */ + @JsonProperty(value = "category") + private RuleCategory category; + + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + @JsonProperty(value = "status") + private RuleStatus status; + + /** Creates an instance of OutboundRule class. */ + public OutboundRule() { + } + + /** + * Get the category property: Category of a managed network Outbound Rule of a machine learning workspace. + * + * @return the category value. + */ + public RuleCategory category() { + return this.category; + } + + /** + * Set the category property: Category of a managed network Outbound Rule of a machine learning workspace. + * + * @param category the category value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withCategory(RuleCategory category) { + this.category = category; + return this; + } + + /** + * Get the status property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the status value. + */ + public RuleStatus status() { + return this.status; + } + + /** + * Set the status property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @param status the status value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withStatus(RuleStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java new file mode 100644 index 0000000000000..bd27d96a839d2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; + +/** An immutable client-side representation of OutboundRuleBasicResource. */ +public interface OutboundRuleBasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @return the properties value. + */ + OutboundRule properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner object. + * + * @return the inner object. + */ + OutboundRuleBasicResourceInner innerModel(); + + /** The entirety of the OutboundRuleBasicResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + + /** The OutboundRuleBasicResource definition stages. */ + interface DefinitionStages { + /** The first stage of the OutboundRuleBasicResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the OutboundRuleBasicResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** The stage of the OutboundRuleBasicResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a machine learning + * workspace.. + * + * @param properties Outbound Rule for the managed network of a machine learning workspace. + * @return the next definition stage. + */ + WithCreate withProperties(OutboundRule properties); + } + + /** + * The stage of the OutboundRuleBasicResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + OutboundRuleBasicResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OutboundRuleBasicResource create(Context context); + } + } + + /** + * Begins update for the OutboundRuleBasicResource resource. + * + * @return the stage of resource update. + */ + OutboundRuleBasicResource.Update update(); + + /** The template for OutboundRuleBasicResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OutboundRuleBasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OutboundRuleBasicResource apply(Context context); + } + + /** The OutboundRuleBasicResource update stages. */ + interface UpdateStages { + /** The stage of the OutboundRuleBasicResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a machine learning + * workspace.. + * + * @param properties Outbound Rule for the managed network of a machine learning workspace. + * @return the next definition stage. + */ + Update withProperties(OutboundRule properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java new file mode 100644 index 0000000000000..acf23002225b1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of outbound rules for the managed network of a machine learning workspace. */ +@Fluent +public final class OutboundRuleListResult { + /* + * The link to the next page constructed using the continuationToken. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to + * request the next list of machine learning workspaces. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of OutboundRuleListResult class. */ + public OutboundRuleListResult() { + } + + /** + * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the OutboundRuleListResult object itself. + */ + public OutboundRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink + * field should be used to request the next list of machine learning workspaces. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink + * field should be used to request the next list of machine learning workspaces. + * + * @param value the value value to set. + * @return the OutboundRuleListResult object itself. + */ + public OutboundRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java index dc75b9e54bee0..13cd14608c055 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java @@ -16,6 +16,9 @@ public final class OutputDeliveryMode extends ExpandableStringEnum { + /** Static value NotStarted for PackageBuildState. */ + public static final PackageBuildState NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PackageBuildState. */ + public static final PackageBuildState RUNNING = fromString("Running"); + + /** Static value Succeeded for PackageBuildState. */ + public static final PackageBuildState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PackageBuildState. */ + public static final PackageBuildState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PackageBuildState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageBuildState() { + } + + /** + * Creates or finds a PackageBuildState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageBuildState. + */ + @JsonCreator + public static PackageBuildState fromString(String name) { + return fromString(name, PackageBuildState.class); + } + + /** + * Gets known PackageBuildState values. + * + * @return known PackageBuildState values. + */ + public static Collection values() { + return values(PackageBuildState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputDeliveryMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputDeliveryMode.java new file mode 100644 index 0000000000000..cb99f68f88d56 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputDeliveryMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Mounting type of the model or the inputs. */ +public final class PackageInputDeliveryMode extends ExpandableStringEnum { + /** Static value Copy for PackageInputDeliveryMode. */ + public static final PackageInputDeliveryMode COPY = fromString("Copy"); + + /** Static value Download for PackageInputDeliveryMode. */ + public static final PackageInputDeliveryMode DOWNLOAD = fromString("Download"); + + /** + * Creates a new instance of PackageInputDeliveryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageInputDeliveryMode() { + } + + /** + * Creates or finds a PackageInputDeliveryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageInputDeliveryMode. + */ + @JsonCreator + public static PackageInputDeliveryMode fromString(String name) { + return fromString(name, PackageInputDeliveryMode.class); + } + + /** + * Gets known PackageInputDeliveryMode values. + * + * @return known PackageInputDeliveryMode values. + */ + public static Collection values() { + return values(PackageInputDeliveryMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathBase.java new file mode 100644 index 0000000000000..c7f873a670c47 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathBase.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The PackageInputPathBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "inputPathType", + defaultImpl = PackageInputPathBase.class) +@JsonTypeName("PackageInputPathBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PathId", value = PackageInputPathId.class), + @JsonSubTypes.Type(name = "Url", value = PackageInputPathUrl.class), + @JsonSubTypes.Type(name = "PathVersion", value = PackageInputPathVersion.class) +}) +@Immutable +public class PackageInputPathBase { + /** Creates an instance of PackageInputPathBase class. */ + public PackageInputPathBase() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathId.java new file mode 100644 index 0000000000000..10c0fface6b46 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathId.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Package input path specified with a resource id. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputPathType") +@JsonTypeName("PathId") +@Fluent +public final class PackageInputPathId extends PackageInputPathBase { + /* + * Input resource id. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** Creates an instance of PackageInputPathId class. */ + public PackageInputPathId() { + } + + /** + * Get the resourceId property: Input resource id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Input resource id. + * + * @param resourceId the resourceId value to set. + * @return the PackageInputPathId object itself. + */ + public PackageInputPathId withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathUrl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathUrl.java new file mode 100644 index 0000000000000..bfb2027b4c440 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathUrl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Package input path specified as an url. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputPathType") +@JsonTypeName("Url") +@Fluent +public final class PackageInputPathUrl extends PackageInputPathBase { + /* + * Input path url. + */ + @JsonProperty(value = "url") + private String url; + + /** Creates an instance of PackageInputPathUrl class. */ + public PackageInputPathUrl() { + } + + /** + * Get the url property: Input path url. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Input path url. + * + * @param url the url value to set. + * @return the PackageInputPathUrl object itself. + */ + public PackageInputPathUrl withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathVersion.java new file mode 100644 index 0000000000000..21fae42ffb74d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputPathVersion.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Package input path specified with name and version. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputPathType") +@JsonTypeName("PathVersion") +@Fluent +public final class PackageInputPathVersion extends PackageInputPathBase { + /* + * Input resource name. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * Input resource version. + */ + @JsonProperty(value = "resourceVersion") + private String resourceVersion; + + /** Creates an instance of PackageInputPathVersion class. */ + public PackageInputPathVersion() { + } + + /** + * Get the resourceName property: Input resource name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: Input resource name. + * + * @param resourceName the resourceName value to set. + * @return the PackageInputPathVersion object itself. + */ + public PackageInputPathVersion withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceVersion property: Input resource version. + * + * @return the resourceVersion value. + */ + public String resourceVersion() { + return this.resourceVersion; + } + + /** + * Set the resourceVersion property: Input resource version. + * + * @param resourceVersion the resourceVersion value to set. + * @return the PackageInputPathVersion object itself. + */ + public PackageInputPathVersion withResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputType.java new file mode 100644 index 0000000000000..18e4a045a435b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageInputType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the inputs. */ +public final class PackageInputType extends ExpandableStringEnum { + /** Static value UriFile for PackageInputType. */ + public static final PackageInputType URI_FILE = fromString("UriFile"); + + /** Static value UriFolder for PackageInputType. */ + public static final PackageInputType URI_FOLDER = fromString("UriFolder"); + + /** + * Creates a new instance of PackageInputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageInputType() { + } + + /** + * Creates or finds a PackageInputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageInputType. + */ + @JsonCreator + public static PackageInputType fromString(String name) { + return fromString(name, PackageInputType.class); + } + + /** + * Gets known PackageInputType values. + * + * @return known PackageInputType values. + */ + public static Collection values() { + return values(PackageInputType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageRequest.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageRequest.java new file mode 100644 index 0000000000000..40274d5753f11 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageRequest.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Model package operation request properties. */ +@Fluent +public final class PackageRequest { + /* + * Base environment to start with. + */ + @JsonProperty(value = "baseEnvironmentSource") + private BaseEnvironmentSource baseEnvironmentSource; + + /* + * Collection of environment variables. + */ + @JsonProperty(value = "environmentVariables") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map environmentVariables; + + /* + * [Required] Inferencing server configurations. + */ + @JsonProperty(value = "inferencingServer", required = true) + private InferencingServer inferencingServer; + + /* + * Collection of inputs. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /* + * Model configuration including the mount mode. + */ + @JsonProperty(value = "modelConfiguration") + private ModelConfiguration modelConfiguration; + + /* + * Tag dictionary. Tags can be added, removed, and updated. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * [Required] Arm ID of the target environment to be created by package operation. + */ + @JsonProperty(value = "targetEnvironmentId", required = true) + private String targetEnvironmentId; + + /** Creates an instance of PackageRequest class. */ + public PackageRequest() { + } + + /** + * Get the baseEnvironmentSource property: Base environment to start with. + * + * @return the baseEnvironmentSource value. + */ + public BaseEnvironmentSource baseEnvironmentSource() { + return this.baseEnvironmentSource; + } + + /** + * Set the baseEnvironmentSource property: Base environment to start with. + * + * @param baseEnvironmentSource the baseEnvironmentSource value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withBaseEnvironmentSource(BaseEnvironmentSource baseEnvironmentSource) { + this.baseEnvironmentSource = baseEnvironmentSource; + return this; + } + + /** + * Get the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Collection of environment variables. + * + * @param environmentVariables the environmentVariables value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the inferencingServer property: [Required] Inferencing server configurations. + * + * @return the inferencingServer value. + */ + public InferencingServer inferencingServer() { + return this.inferencingServer; + } + + /** + * Set the inferencingServer property: [Required] Inferencing server configurations. + * + * @param inferencingServer the inferencingServer value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withInferencingServer(InferencingServer inferencingServer) { + this.inferencingServer = inferencingServer; + return this; + } + + /** + * Get the inputs property: Collection of inputs. + * + * @return the inputs value. + */ + public List inputs() { + return this.inputs; + } + + /** + * Set the inputs property: Collection of inputs. + * + * @param inputs the inputs value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withInputs(List inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the modelConfiguration property: Model configuration including the mount mode. + * + * @return the modelConfiguration value. + */ + public ModelConfiguration modelConfiguration() { + return this.modelConfiguration; + } + + /** + * Set the modelConfiguration property: Model configuration including the mount mode. + * + * @param modelConfiguration the modelConfiguration value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withModelConfiguration(ModelConfiguration modelConfiguration) { + this.modelConfiguration = modelConfiguration; + return this; + } + + /** + * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @param tags the tags value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the targetEnvironmentId property: [Required] Arm ID of the target environment to be created by package + * operation. + * + * @return the targetEnvironmentId value. + */ + public String targetEnvironmentId() { + return this.targetEnvironmentId; + } + + /** + * Set the targetEnvironmentId property: [Required] Arm ID of the target environment to be created by package + * operation. + * + * @param targetEnvironmentId the targetEnvironmentId value to set. + * @return the PackageRequest object itself. + */ + public PackageRequest withTargetEnvironmentId(String targetEnvironmentId) { + this.targetEnvironmentId = targetEnvironmentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseEnvironmentSource() != null) { + baseEnvironmentSource().validate(); + } + if (inferencingServer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property inferencingServer in model PackageRequest")); + } else { + inferencingServer().validate(); + } + if (inputs() != null) { + inputs().forEach(e -> e.validate()); + } + if (modelConfiguration() != null) { + modelConfiguration().validate(); + } + if (targetEnvironmentId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetEnvironmentId in model PackageRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PackageRequest.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageResponse.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageResponse.java new file mode 100644 index 0000000000000..d890d15102886 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PackageResponse.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PackageResponse. */ +public interface PackageResponse { + /** + * Gets the baseEnvironmentSource property: Base environment to start with. + * + * @return the baseEnvironmentSource value. + */ + BaseEnvironmentSource baseEnvironmentSource(); + + /** + * Gets the buildId property: Build id of the image build operation. + * + * @return the buildId value. + */ + String buildId(); + + /** + * Gets the buildState property: Build state of the image build operation. + * + * @return the buildState value. + */ + PackageBuildState buildState(); + + /** + * Gets the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + Map environmentVariables(); + + /** + * Gets the inferencingServer property: Inferencing server configurations. + * + * @return the inferencingServer value. + */ + InferencingServer inferencingServer(); + + /** + * Gets the inputs property: Collection of inputs. + * + * @return the inputs value. + */ + List inputs(); + + /** + * Gets the logUrl property: Log url of the image build operation. + * + * @return the logUrl value. + */ + String logUrl(); + + /** + * Gets the modelConfiguration property: Model configuration including the mount mode. + * + * @return the modelConfiguration value. + */ + ModelConfiguration modelConfiguration(); + + /** + * Gets the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the targetEnvironmentId property: Asset ID of the target environment created by package operation. + * + * @return the targetEnvironmentId value. + */ + String targetEnvironmentId(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PackageResponseInner object. + * + * @return the inner object. + */ + PackageResponseInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBase.java new file mode 100644 index 0000000000000..3a9cfd9d307cd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBase.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Mutable base definition for a job. */ +@Fluent +public final class PartialJobBase { + /* + * Mutable notification setting for the job + */ + @JsonProperty(value = "notificationSetting") + private PartialNotificationSetting notificationSetting; + + /** Creates an instance of PartialJobBase class. */ + public PartialJobBase() { + } + + /** + * Get the notificationSetting property: Mutable notification setting for the job. + * + * @return the notificationSetting value. + */ + public PartialNotificationSetting notificationSetting() { + return this.notificationSetting; + } + + /** + * Set the notificationSetting property: Mutable notification setting for the job. + * + * @param notificationSetting the notificationSetting value to set. + * @return the PartialJobBase object itself. + */ + public PartialJobBase withNotificationSetting(PartialNotificationSetting notificationSetting) { + this.notificationSetting = notificationSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (notificationSetting() != null) { + notificationSetting().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBasePartialResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBasePartialResource.java new file mode 100644 index 0000000000000..f062b86493462 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialJobBasePartialResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Resource Manager resource envelope strictly used in update requests. */ +@Fluent +public final class PartialJobBasePartialResource { + /* + * Additional attributes of the entity. + */ + @JsonProperty(value = "properties") + private PartialJobBase properties; + + /** Creates an instance of PartialJobBasePartialResource class. */ + public PartialJobBasePartialResource() { + } + + /** + * Get the properties property: Additional attributes of the entity. + * + * @return the properties value. + */ + public PartialJobBase properties() { + return this.properties; + } + + /** + * Set the properties property: Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the PartialJobBasePartialResource object itself. + */ + public PartialJobBasePartialResource withProperties(PartialJobBase properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java index 1939e23433ba5..5d45498c214e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java @@ -11,7 +11,7 @@ /** Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public class PartialManagedServiceIdentity { +public final class PartialManagedServiceIdentity { /* * Managed service identity (system assigned and/or user assigned identities) */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java index 7187063fa6cc7..115d8eaaf4c37 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java @@ -10,7 +10,7 @@ /** Strictly used in update requests. */ @Fluent -public class PartialMinimalTrackedResourceWithIdentity extends PartialMinimalTrackedResource { +public final class PartialMinimalTrackedResourceWithIdentity extends PartialMinimalTrackedResource { /* * Managed service identity (system assigned and/or user assigned identities) */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialNotificationSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialNotificationSetting.java new file mode 100644 index 0000000000000..e3eed3726db57 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialNotificationSetting.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Mutable configuration for notification. */ +@Fluent +public final class PartialNotificationSetting { + /* + * Send webhook callback to a service. Key is a user-provided name for the webhook. + */ + @JsonProperty(value = "webhooks") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map webhooks; + + /** Creates an instance of PartialNotificationSetting class. */ + public PartialNotificationSetting() { + } + + /** + * Get the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @return the webhooks value. + */ + public Map webhooks() { + return this.webhooks; + } + + /** + * Set the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @param webhooks the webhooks value to set. + * @return the PartialNotificationSetting object itself. + */ + public PartialNotificationSetting withWebhooks(Map webhooks) { + this.webhooks = webhooks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webhooks() != null) { + webhooks() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java new file mode 100644 index 0000000000000..60d06f0bc28fb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Strictly used in update requests. */ +@Fluent +public final class PartialRegistryPartialTrackedResource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + @JsonProperty(value = "identity") + private RegistryPartialManagedServiceIdentity identity; + + /* + * Sku details required for ARM contract for Autoscaling. + */ + @JsonProperty(value = "sku") + private PartialSku sku; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of PartialRegistryPartialTrackedResource class. */ + public PartialRegistryPartialTrackedResource() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public RegistryPartialManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withIdentity(RegistryPartialManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public PartialSku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withSku(PartialSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java index 068f4b6b123a3..88259fb4398f3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The PatAuthTypeWorkspaceConnectionProperties model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -54,22 +55,22 @@ public PatAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory /** {@inheritDoc} */ @Override - public PatAuthTypeWorkspaceConnectionProperties withTarget(String target) { - super.withTarget(target); + public PatAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); return this; } /** {@inheritDoc} */ @Override - public PatAuthTypeWorkspaceConnectionProperties withValue(String value) { - super.withValue(value); + public PatAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); return this; } /** {@inheritDoc} */ @Override - public PatAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { - super.withValueFormat(valueFormat); + public PatAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java new file mode 100644 index 0000000000000..bbb55bb1a2c64 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The PendingUploadCredentialDto model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "credentialType", + defaultImpl = PendingUploadCredentialDto.class) +@JsonTypeName("PendingUploadCredentialDto") +@JsonSubTypes({@JsonSubTypes.Type(name = "SAS", value = SasCredentialDto.class)}) +@Immutable +public class PendingUploadCredentialDto { + /** Creates an instance of PendingUploadCredentialDto class. */ + public PendingUploadCredentialDto() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java new file mode 100644 index 0000000000000..df16576c1d638 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the PendingUpload credentials type. */ +public final class PendingUploadCredentialType extends ExpandableStringEnum { + /** Static value SAS for PendingUploadCredentialType. */ + public static final PendingUploadCredentialType SAS = fromString("SAS"); + + /** + * Creates a new instance of PendingUploadCredentialType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PendingUploadCredentialType() { + } + + /** + * Creates or finds a PendingUploadCredentialType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PendingUploadCredentialType. + */ + @JsonCreator + public static PendingUploadCredentialType fromString(String name) { + return fromString(name, PendingUploadCredentialType.class); + } + + /** + * Gets known PendingUploadCredentialType values. + * + * @return known PendingUploadCredentialType values. + */ + public static Collection values() { + return values(PendingUploadCredentialType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java new file mode 100644 index 0000000000000..9a7919e4c98e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PendingUploadRequestDto model. */ +@Fluent +public final class PendingUploadRequestDto { + /* + * If PendingUploadId = null then random guid will be used. + */ + @JsonProperty(value = "pendingUploadId") + private String pendingUploadId; + + /* + * TemporaryBlobReference is the only supported type + */ + @JsonProperty(value = "pendingUploadType") + private PendingUploadType pendingUploadType; + + /** Creates an instance of PendingUploadRequestDto class. */ + public PendingUploadRequestDto() { + } + + /** + * Get the pendingUploadId property: If PendingUploadId = null then random guid will be used. + * + * @return the pendingUploadId value. + */ + public String pendingUploadId() { + return this.pendingUploadId; + } + + /** + * Set the pendingUploadId property: If PendingUploadId = null then random guid will be used. + * + * @param pendingUploadId the pendingUploadId value to set. + * @return the PendingUploadRequestDto object itself. + */ + public PendingUploadRequestDto withPendingUploadId(String pendingUploadId) { + this.pendingUploadId = pendingUploadId; + return this; + } + + /** + * Get the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + public PendingUploadType pendingUploadType() { + return this.pendingUploadType; + } + + /** + * Set the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @param pendingUploadType the pendingUploadType value to set. + * @return the PendingUploadRequestDto object itself. + */ + public PendingUploadRequestDto withPendingUploadType(PendingUploadType pendingUploadType) { + this.pendingUploadType = pendingUploadType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java new file mode 100644 index 0000000000000..477fc75058cfb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; + +/** An immutable client-side representation of PendingUploadResponseDto. */ +public interface PendingUploadResponseDto { + /** + * Gets the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @return the blobReferenceForConsumption value. + */ + BlobReferenceForConsumptionDto blobReferenceForConsumption(); + + /** + * Gets the pendingUploadId property: ID for this upload request. + * + * @return the pendingUploadId value. + */ + String pendingUploadId(); + + /** + * Gets the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + PendingUploadType pendingUploadType(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner object. + * + * @return the inner object. + */ + PendingUploadResponseDtoInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java new file mode 100644 index 0000000000000..22f1e4abb5404 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of storage to use for the pending upload location. */ +public final class PendingUploadType extends ExpandableStringEnum { + /** Static value None for PendingUploadType. */ + public static final PendingUploadType NONE = fromString("None"); + + /** Static value TemporaryBlobReference for PendingUploadType. */ + public static final PendingUploadType TEMPORARY_BLOB_REFERENCE = fromString("TemporaryBlobReference"); + + /** + * Creates a new instance of PendingUploadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PendingUploadType() { + } + + /** + * Creates or finds a PendingUploadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PendingUploadType. + */ + @JsonCreator + public static PendingUploadType fromString(String name) { + return fromString(name, PendingUploadType.class); + } + + /** + * Gets known PendingUploadType values. + * + * @return known PendingUploadType values. + */ + public static Collection values() { + return values(PendingUploadType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java index 38dd2499a528a..cfc7c6a72501f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java @@ -195,6 +195,20 @@ public PipelineJob withIsArchived(Boolean isArchived) { return this; } + /** {@inheritDoc} */ + @Override + public PipelineJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public PipelineJob withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + /** {@inheritDoc} */ @Override public PipelineJob withServices(Map services) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java new file mode 100644 index 0000000000000..cff6d02a995bc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The PredictionDriftMetricThresholdBase model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "dataType", + defaultImpl = PredictionDriftMetricThresholdBase.class) +@JsonTypeName("PredictionDriftMetricThresholdBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Categorical", value = CategoricalPredictionDriftMetricThreshold.class), + @JsonSubTypes.Type(name = "Numerical", value = NumericalPredictionDriftMetricThreshold.class) +}) +@Fluent +public class PredictionDriftMetricThresholdBase { + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + @JsonProperty(value = "threshold") + private MonitoringThreshold threshold; + + /** Creates an instance of PredictionDriftMetricThresholdBase class. */ + public PredictionDriftMetricThresholdBase() { + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the PredictionDriftMetricThresholdBase object itself. + */ + public PredictionDriftMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java new file mode 100644 index 0000000000000..3488c35d8b541 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** The PredictionDriftMonitoringSignal model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "signalType") +@JsonTypeName("PredictionDrift") +@Fluent +public final class PredictionDriftMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + @JsonProperty(value = "metricThresholds", required = true) + private List metricThresholds; + + /* + * [Required] The type of the model monitored. + */ + @JsonProperty(value = "modelType", required = true) + private MonitoringModelType modelType; + + /* + * [Required] The data which drift will be calculated for. + */ + @JsonProperty(value = "productionData", required = true) + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + @JsonProperty(value = "referenceData", required = true) + private MonitoringInputDataBase referenceData; + + /** Creates an instance of PredictionDriftMonitoringSignal class. */ + public PredictionDriftMonitoringSignal() { + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withMetricThresholds( + List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the modelType property: [Required] The type of the model monitored. + * + * @return the modelType value. + */ + public MonitoringModelType modelType() { + return this.modelType; + } + + /** + * Set the modelType property: [Required] The type of the model monitored. + * + * @param modelType the modelType value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withModelType(MonitoringModelType modelType) { + this.modelType = modelType; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** {@inheritDoc} */ + @Override + public PredictionDriftMonitoringSignal withMode(MonitoringNotificationMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public PredictionDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metricThresholds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metricThresholds in model PredictionDriftMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (modelType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property modelType in model PredictionDriftMonitoringSignal")); + } + if (productionData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property productionData in model PredictionDriftMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property referenceData in model PredictionDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PredictionDriftMonitoringSignal.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java index 7d3cdfb6741b6..3a94648f8c19d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java @@ -9,19 +9,13 @@ /** The Private Endpoint resource. */ @Immutable -public final class PrivateEndpoint { +public class PrivateEndpoint { /* * The ARM identifier for Private Endpoint */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /* - * The ARM identifier for Subnet resource that private endpoint links to - */ - @JsonProperty(value = "subnetArmId", access = JsonProperty.Access.WRITE_ONLY) - private String subnetArmId; - /** Creates an instance of PrivateEndpoint class. */ public PrivateEndpoint() { } @@ -35,15 +29,6 @@ public String id() { return this.id; } - /** - * Get the subnetArmId property: The ARM identifier for Subnet resource that private endpoint links to. - * - * @return the subnetArmId value. - */ - public String subnetArmId() { - return this.subnetArmId; - } - /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java index 18d85548f8cb2..0f3600a26b18d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java @@ -34,32 +34,33 @@ public interface PrivateEndpointConnection { String type(); /** - * Gets the identity property: The identity of the resource. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ ManagedServiceIdentity identity(); /** - * Gets the location property: Specifies the location of the resource. + * Gets the location property: Same as workspace location. * * @return the location value. */ String location(); /** - * Gets the tags property: Contains resource tags defined as key/value pairs. + * Gets the sku property: Optional. This field is required to be implemented by the RP because AML is supporting + * more than one tier. * - * @return the tags value. + * @return the sku value. */ - Map tags(); + Sku sku(); /** - * Gets the sku property: The sku of the workspace. + * Gets the tags property: Dictionary of <string>. * - * @return the sku value. + * @return the tags value. */ - Sku sku(); + Map tags(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -69,22 +70,21 @@ public interface PrivateEndpointConnection { SystemData systemData(); /** - * Gets the privateEndpoint property: The resource of private end point. + * Gets the privateEndpoint property: The Private Endpoint resource. * * @return the privateEndpoint value. */ - PrivateEndpoint privateEndpoint(); + WorkspacePrivateEndpointResource privateEndpoint(); /** - * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the - * connection between service consumer and provider. + * Gets the privateLinkServiceConnectionState property: The connection state. * * @return the privateLinkServiceConnectionState value. */ PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); /** - * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * Gets the provisioningState property: The current provisioning state. * * @return the provisioningState value. */ @@ -122,11 +122,13 @@ public interface PrivateEndpointConnection { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The PrivateEndpointConnection definition stages. */ interface DefinitionStages { /** The first stage of the PrivateEndpointConnection definition. */ interface Blank extends WithParentResource { } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -138,6 +140,7 @@ interface WithParentResource { */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. @@ -164,12 +167,13 @@ interface WithCreate */ PrivateEndpointConnection create(Context context); } + /** The stage of the PrivateEndpointConnection definition allowing to specify location. */ interface WithLocation { /** * Specifies the region for the resource. * - * @param location Specifies the location of the resource. + * @param location Same as workspace location. * @return the next definition stage. */ WithCreate withRegion(Region location); @@ -177,67 +181,74 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location Specifies the location of the resource. + * @param location Same as workspace location. * @return the next definition stage. */ WithCreate withRegion(String location); } + /** The stage of the PrivateEndpointConnection definition allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Contains resource tags defined as key/value pairs.. + * Specifies the tags property: Dictionary of <string>. * - * @param tags Contains resource tags defined as key/value pairs. + * @param tags Dictionary of <string>. * @return the next definition stage. */ WithCreate withTags(Map tags); } + /** The stage of the PrivateEndpointConnection definition allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity of the resource. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the PrivateEndpointConnection definition allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: The sku of the workspace.. + * Specifies the sku property: Optional. This field is required to be implemented by the RP because AML is + * supporting more than one tier. * - * @param sku The sku of the workspace. + * @param sku Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * @return the next definition stage. */ WithCreate withSku(Sku sku); } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. + * Specifies the privateEndpoint property: The Private Endpoint resource.. * - * @param privateEndpoint The resource of private end point. + * @param privateEndpoint The Private Endpoint resource. * @return the next definition stage. */ - WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + WithCreate withPrivateEndpoint(WorkspacePrivateEndpointResource privateEndpoint); } + /** * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. */ interface WithPrivateLinkServiceConnectionState { /** - * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of - * the connection between service consumer and provider.. + * Specifies the privateLinkServiceConnectionState property: The connection state.. * - * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * @param privateLinkServiceConnectionState The connection state. * @return the next definition stage. */ WithCreate withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Begins update for the PrivateEndpointConnection resource. * @@ -267,62 +278,69 @@ interface Update */ PrivateEndpointConnection apply(Context context); } + /** The PrivateEndpointConnection update stages. */ interface UpdateStages { /** The stage of the PrivateEndpointConnection update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Contains resource tags defined as key/value pairs.. + * Specifies the tags property: Dictionary of <string>. * - * @param tags Contains resource tags defined as key/value pairs. + * @param tags Dictionary of <string>. * @return the next definition stage. */ Update withTags(Map tags); } + /** The stage of the PrivateEndpointConnection update allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity of the resource. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); } + /** The stage of the PrivateEndpointConnection update allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: The sku of the workspace.. + * Specifies the sku property: Optional. This field is required to be implemented by the RP because AML is + * supporting more than one tier. * - * @param sku The sku of the workspace. + * @param sku Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * @return the next definition stage. */ Update withSku(Sku sku); } + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. + * Specifies the privateEndpoint property: The Private Endpoint resource.. * - * @param privateEndpoint The resource of private end point. + * @param privateEndpoint The Private Endpoint resource. * @return the next definition stage. */ - Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + Update withPrivateEndpoint(WorkspacePrivateEndpointResource privateEndpoint); } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ interface WithPrivateLinkServiceConnectionState { /** - * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of - * the connection between service consumer and provider.. + * Specifies the privateLinkServiceConnectionState property: The connection state.. * - * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * @param privateLinkServiceConnectionState The connection state. * @return the next definition stage. */ Update withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java index c660b6ad5ca1b..97658c7c71adc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java @@ -11,7 +11,7 @@ /** Resource collection API of PrivateEndpointConnections. */ public interface PrivateEndpointConnections { /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -24,7 +24,7 @@ public interface PrivateEndpointConnections { PagedIterable list(String resourceGroupName, String workspaceName); /** - * List all the private endpoint connections associated with the workspace. + * Called by end-users to get all PE connections. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -38,85 +38,85 @@ public interface PrivateEndpointConnections { PagedIterable list(String resourceGroupName, String workspaceName, Context context); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse( + Response deleteWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace. */ - PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response deleteWithResponse( + Response getWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. + * @param privateEndpointConnectionName NRP Private Endpoint Connection Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. */ - void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ PrivateEndpointConnection getById(String id); /** - * Gets the specified private endpoint connection associated with the workspace. + * Called by end-users to get a PE connection. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the workspace along with {@link Response}. + * @return the Private Endpoint Connection resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,7 +126,7 @@ Response deleteWithResponse( void deleteById(String id); /** - * Deletes the specified private endpoint connection associated with the workspace. + * Called by end-users to delete a PE connection. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java new file mode 100644 index 0000000000000..d64ab5549c889 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning + * workspace. + */ +@Fluent +public final class PrivateEndpointDestination { + /* + * The serviceResourceId property. + */ + @JsonProperty(value = "serviceResourceId") + private String serviceResourceId; + + /* + * The sparkEnabled property. + */ + @JsonProperty(value = "sparkEnabled") + private Boolean sparkEnabled; + + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + @JsonProperty(value = "sparkStatus") + private RuleStatus sparkStatus; + + /* + * The subresourceTarget property. + */ + @JsonProperty(value = "subresourceTarget") + private String subresourceTarget; + + /** Creates an instance of PrivateEndpointDestination class. */ + public PrivateEndpointDestination() { + } + + /** + * Get the serviceResourceId property: The serviceResourceId property. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Set the serviceResourceId property: The serviceResourceId property. + * + * @param serviceResourceId the serviceResourceId value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withServiceResourceId(String serviceResourceId) { + this.serviceResourceId = serviceResourceId; + return this; + } + + /** + * Get the sparkEnabled property: The sparkEnabled property. + * + * @return the sparkEnabled value. + */ + public Boolean sparkEnabled() { + return this.sparkEnabled; + } + + /** + * Set the sparkEnabled property: The sparkEnabled property. + * + * @param sparkEnabled the sparkEnabled value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSparkEnabled(Boolean sparkEnabled) { + this.sparkEnabled = sparkEnabled; + return this; + } + + /** + * Get the sparkStatus property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the sparkStatus value. + */ + public RuleStatus sparkStatus() { + return this.sparkStatus; + } + + /** + * Set the sparkStatus property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @param sparkStatus the sparkStatus value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSparkStatus(RuleStatus sparkStatus) { + this.sparkStatus = sparkStatus; + return this; + } + + /** + * Get the subresourceTarget property: The subresourceTarget property. + * + * @return the subresourceTarget value. + */ + public String subresourceTarget() { + return this.subresourceTarget; + } + + /** + * Set the subresourceTarget property: The subresourceTarget property. + * + * @param subresourceTarget the subresourceTarget value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSubresourceTarget(String subresourceTarget) { + this.subresourceTarget = subresourceTarget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java new file mode 100644 index 0000000000000..9bdea77327c09 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Private Endpoint Outbound Rule for the managed network of a machine learning workspace. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("PrivateEndpoint") +@Fluent +public final class PrivateEndpointOutboundRule extends OutboundRule { + /* + * Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning + * workspace. + */ + @JsonProperty(value = "destination") + private PrivateEndpointDestination destination; + + /** Creates an instance of PrivateEndpointOutboundRule class. */ + public PrivateEndpointOutboundRule() { + } + + /** + * Get the destination property: Private Endpoint destination for a Private Endpoint Outbound Rule for the managed + * network of a machine learning workspace. + * + * @return the destination value. + */ + public PrivateEndpointDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Private Endpoint destination for a Private Endpoint Outbound Rule for the managed + * network of a machine learning workspace. + * + * @param destination the destination value to set. + * @return the PrivateEndpointOutboundRule object itself. + */ + public PrivateEndpointOutboundRule withDestination(PrivateEndpointDestination destination) { + this.destination = destination; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (destination() != null) { + destination().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java new file mode 100644 index 0000000000000..42e8760defa93 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PE network resource that is linked to this PE connection. */ +@Fluent +public final class PrivateEndpointResource extends PrivateEndpoint { + /* + * The subnetId that the private endpoint is connected to. + */ + @JsonProperty(value = "subnetArmId") + private String subnetArmId; + + /** Creates an instance of PrivateEndpointResource class. */ + public PrivateEndpointResource() { + } + + /** + * Get the subnetArmId property: The subnetId that the private endpoint is connected to. + * + * @return the subnetArmId value. + */ + public String subnetArmId() { + return this.subnetArmId; + } + + /** + * Set the subnetArmId property: The subnetId that the private endpoint is connected to. + * + * @param subnetArmId the subnetArmId value to set. + * @return the PrivateEndpointResource object itself. + */ + public PrivateEndpointResource withSubnetArmId(String subnetArmId) { + this.subnetArmId = subnetArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 0173735ec3571..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The private endpoint connection status. */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** Static value Timeout for PrivateEndpointServiceConnectionStatus. */ - public static final PrivateEndpointServiceConnectionStatus TIMEOUT = fromString("Timeout"); - - /** - * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointServiceConnectionStatus() { - } - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - @JsonCreator - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** - * Gets known PrivateEndpointServiceConnectionStatus values. - * - * @return known PrivateEndpointServiceConnectionStatus values. - */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java index a98acd180051b..01c77ae4602c4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java @@ -4,212 +4,95 @@ package com.azure.resourcemanager.machinelearning.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; import java.util.List; import java.util.Map; -/** A private link resource. */ -@Fluent -public final class PrivateLinkResource extends ProxyResource { - /* - * Resource properties. - */ - @JsonProperty(value = "properties") - private PrivateLinkResourceProperties innerProperties; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /* - * Specifies the location of the resource. - */ - @JsonProperty(value = "location") - private String location; - - /* - * Contains resource tags defined as key/value pairs. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The sku of the workspace. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /** Creates an instance of PrivateLinkResource class. */ - public PrivateLinkResource() { - } - +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { /** - * Get the innerProperties property: Resource properties. + * Gets the id property: Fully qualified resource Id for the resource. * - * @return the innerProperties value. + * @return the id value. */ - private PrivateLinkResourceProperties innerProperties() { - return this.innerProperties; - } + String id(); /** - * Get the identity property: The identity of the resource. + * Gets the name property: The name of the resource. * - * @return the identity value. + * @return the name value. */ - public ManagedServiceIdentity identity() { - return this.identity; - } + String name(); /** - * Set the identity property: The identity of the resource. + * Gets the type property: The type of the resource. * - * @param identity the identity value to set. - * @return the PrivateLinkResource object itself. + * @return the type value. */ - public PrivateLinkResource withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } + String type(); /** - * Get the location property: Specifies the location of the resource. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Specifies the location of the resource. - * - * @param location the location value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Contains resource tags defined as key/value pairs. - * - * @return the tags value. + * @return the identity value. */ - public Map tags() { - return this.tags; - } + ManagedServiceIdentity identity(); /** - * Set the tags property: Contains resource tags defined as key/value pairs. + * Gets the location property: Same as workspace location. * - * @param tags the tags value to set. - * @return the PrivateLinkResource object itself. + * @return the location value. */ - public PrivateLinkResource withTags(Map tags) { - this.tags = tags; - return this; - } + String location(); /** - * Get the sku property: The sku of the workspace. + * Gets the sku property: Optional. This field is required to be implemented by the RP because AML is supporting + * more than one tier. * * @return the sku value. */ - public Sku sku() { - return this.sku; - } + Sku sku(); /** - * Set the sku property: The sku of the workspace. + * Gets the tags property: Dictionary of <string>. * - * @param sku the sku value to set. - * @return the PrivateLinkResource object itself. + * @return the tags value. */ - public PrivateLinkResource withSku(Sku sku) { - this.sku = sku; - return this; - } + Map tags(); /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ - public SystemData systemData() { - return this.systemData; - } + SystemData systemData(); /** - * Get the groupId property: The private link resource group id. + * Gets the groupId property: The private link resource group id. * * @return the groupId value. */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); - } + String groupId(); /** - * Get the requiredMembers property: The private link resource required member names. + * Gets the requiredMembers property: The private link resource required member names. * * @return the requiredMembers value. */ - public List requiredMembers() { - return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); - } + List requiredMembers(); /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. * * @return the requiredZoneNames value. */ - public List requiredZoneNames() { - return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); - } - - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } + List requiredZoneNames(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - } + PrivateLinkResourceInner innerModel(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java index a2e329b0c1adf..b41f8c36fdb76 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java @@ -4,22 +4,52 @@ package com.azure.resourcemanager.machinelearning.models; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** An immutable client-side representation of PrivateLinkResourceListResult. */ -public interface PrivateLinkResourceListResult { +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResult { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + /** - * Gets the value property: Array of private link resources. + * Get the value property: The value property. * * @return the value value. */ - List value(); + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } /** - * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner object. + * Validates the instance. * - * @return the inner object. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - PrivateLinkResourceListResultInner innerModel(); + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java index 76dbb0e8e76eb..996a9b1e13c91 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java @@ -4,34 +4,41 @@ package com.azure.resourcemanager.machinelearning.models; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** Resource collection API of PrivateLinkResources. */ public interface PrivateLinkResources { /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace along with {@link Response}. + * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Gets the private link resources that need to be created for a workspace. + * Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. Each "private + * link resource" is a connection endpoint (IP address) to the resource. Pre single connection endpoint per + * workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, have multiple + * - one for Blobs, other for Queues, etc. Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for + * GroupIds". * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace. + * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PrivateLinkResourceListResult list(String resourceGroupName, String workspaceName); + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java index bd4774e9026c0..9f3b124fab6b1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java @@ -11,51 +11,49 @@ @Fluent public final class PrivateLinkServiceConnectionState { /* - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + * Some RP chose "None". Other RPs use this for region expansion. */ - @JsonProperty(value = "status") - private PrivateEndpointServiceConnectionStatus status; + @JsonProperty(value = "actionsRequired") + private String actionsRequired; /* - * The reason for approval/rejection of the connection. + * User-defined message that, per NRP doc, may be used for approval-related message. */ @JsonProperty(value = "description") private String description; /* - * A message indicating if changes on the service provider require any updates on the consumer. + * Connection status of the service consumer with the service provider */ - @JsonProperty(value = "actionsRequired") - private String actionsRequired; + @JsonProperty(value = "status") + private EndpointServiceConnectionStatus status; /** Creates an instance of PrivateLinkServiceConnectionState class. */ public PrivateLinkServiceConnectionState() { } /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Get the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. * - * @return the status value. + * @return the actionsRequired value. */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; + public String actionsRequired() { + return this.actionsRequired; } /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Set the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. * - * @param status the status value to set. + * @param actionsRequired the actionsRequired value to set. * @return the PrivateLinkServiceConnectionState object itself. */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; return this; } /** - * Get the description property: The reason for approval/rejection of the connection. + * Get the description property: User-defined message that, per NRP doc, may be used for approval-related message. * * @return the description value. */ @@ -64,7 +62,7 @@ public String description() { } /** - * Set the description property: The reason for approval/rejection of the connection. + * Set the description property: User-defined message that, per NRP doc, may be used for approval-related message. * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. @@ -75,24 +73,22 @@ public PrivateLinkServiceConnectionState withDescription(String description) { } /** - * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. + * Get the status property: Connection status of the service consumer with the service provider. * - * @return the actionsRequired value. + * @return the status value. */ - public String actionsRequired() { - return this.actionsRequired; + public EndpointServiceConnectionStatus status() { + return this.status; } /** - * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. + * Set the status property: Connection status of the service consumer with the service provider. * - * @param actionsRequired the actionsRequired value to set. + * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; + public PrivateLinkServiceConnectionState withStatus(EndpointServiceConnectionStatus status) { + this.status = status; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProgressMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProgressMetrics.java new file mode 100644 index 0000000000000..eaec71041991b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProgressMetrics.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Progress metrics definition. */ +@Immutable +public final class ProgressMetrics { + /* + * The completed datapoint count. + */ + @JsonProperty(value = "completedDatapointCount", access = JsonProperty.Access.WRITE_ONLY) + private Long completedDatapointCount; + + /* + * The time of last successful incremental data refresh in UTC. + */ + @JsonProperty(value = "incrementalDataLastRefreshDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime incrementalDataLastRefreshDateTime; + + /* + * The skipped datapoint count. + */ + @JsonProperty(value = "skippedDatapointCount", access = JsonProperty.Access.WRITE_ONLY) + private Long skippedDatapointCount; + + /* + * The total datapoint count. + */ + @JsonProperty(value = "totalDatapointCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalDatapointCount; + + /** Creates an instance of ProgressMetrics class. */ + public ProgressMetrics() { + } + + /** + * Get the completedDatapointCount property: The completed datapoint count. + * + * @return the completedDatapointCount value. + */ + public Long completedDatapointCount() { + return this.completedDatapointCount; + } + + /** + * Get the incrementalDataLastRefreshDateTime property: The time of last successful incremental data refresh in UTC. + * + * @return the incrementalDataLastRefreshDateTime value. + */ + public OffsetDateTime incrementalDataLastRefreshDateTime() { + return this.incrementalDataLastRefreshDateTime; + } + + /** + * Get the skippedDatapointCount property: The skipped datapoint count. + * + * @return the skippedDatapointCount value. + */ + public Long skippedDatapointCount() { + return this.skippedDatapointCount; + } + + /** + * Get the totalDatapointCount property: The total datapoint count. + * + * @return the totalDatapointCount value. + */ + public Long totalDatapointCount() { + return this.totalDatapointCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProtectionLevel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProtectionLevel.java new file mode 100644 index 0000000000000..15e61cc741ada --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProtectionLevel.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Protection level associated with the Intellectual Property. */ +public final class ProtectionLevel extends ExpandableStringEnum { + /** Static value All for ProtectionLevel. */ + public static final ProtectionLevel ALL = fromString("All"); + + /** Static value None for ProtectionLevel. */ + public static final ProtectionLevel NONE = fromString("None"); + + /** + * Creates a new instance of ProtectionLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtectionLevel() { + } + + /** + * Creates or finds a ProtectionLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionLevel. + */ + @JsonCreator + public static ProtectionLevel fromString(String name) { + return fromString(name, ProtectionLevel.class); + } + + /** + * Gets known ProtectionLevel values. + * + * @return known ProtectionLevel values. + */ + public static Collection values() { + return values(ProtectionLevel.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java new file mode 100644 index 0000000000000..5ec7bb5a28f5d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Endpoint Communication Protocol + * + *

Protocol over which communication will happen over this endpoint. + */ +public final class Protocol extends ExpandableStringEnum { + /** Static value tcp for Protocol. */ + public static final Protocol TCP = fromString("tcp"); + + /** Static value udp for Protocol. */ + public static final Protocol UDP = fromString("udp"); + + /** Static value http for Protocol. */ + public static final Protocol HTTP = fromString("http"); + + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * Gets known Protocol values. + * + * @return known Protocol values. + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java index 0c3c664d77498..3319ed1e3f528 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java @@ -8,10 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** - * The current deployment state of workspace resource. The provisioningState is to indicate states for resource - * provisioning. - */ +/** The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. */ public final class ProvisioningState extends ExpandableStringEnum { /** Static value Unknown for ProvisioningState. */ public static final ProvisioningState UNKNOWN = fromString("Unknown"); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java deleted file mode 100644 index c18df6cfe6886..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Whether requests from Public Network are allowed. */ -public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ - public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - - /** Static value Disabled for PublicNetworkAccess. */ - public static final PublicNetworkAccess DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of PublicNetworkAccess value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PublicNetworkAccess() { - } - - /** - * Creates or finds a PublicNetworkAccess from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicNetworkAccess. - */ - @JsonCreator - public static PublicNetworkAccess fromString(String name) { - return fromString(name, PublicNetworkAccess.class); - } - - /** - * Gets known PublicNetworkAccess values. - * - * @return known PublicNetworkAccess values. - */ - public static Collection values() { - return values(PublicNetworkAccess.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java new file mode 100644 index 0000000000000..b029e9c235b46 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The QueueSettings model. */ +@Fluent +public final class QueueSettings { + /* + * Controls the compute job tier + */ + @JsonProperty(value = "jobTier") + private JobTier jobTier; + + /* + * Controls the priority of the job on a compute. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** Creates an instance of QueueSettings class. */ + public QueueSettings() { + } + + /** + * Get the jobTier property: Controls the compute job tier. + * + * @return the jobTier value. + */ + public JobTier jobTier() { + return this.jobTier; + } + + /** + * Set the jobTier property: Controls the compute job tier. + * + * @param jobTier the jobTier value to set. + * @return the QueueSettings object itself. + */ + public QueueSettings withJobTier(JobTier jobTier) { + this.jobTier = jobTier; + return this; + } + + /** + * Get the priority property: Controls the priority of the job on a compute. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Controls the priority of the job on a compute. + * + * @param priority the priority value to set. + * @return the QueueSettings object itself. + */ + public QueueSettings withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java index cdb0b372a2445..6332978c729cf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java @@ -14,6 +14,12 @@ @JsonTypeName("Random") @Fluent public final class RandomSamplingAlgorithm extends SamplingAlgorithm { + /* + * An optional positive number or e in string format to be used as base for log based random sampling + */ + @JsonProperty(value = "logbase") + private String logbase; + /* * The specific type of random algorithm */ @@ -30,6 +36,28 @@ public final class RandomSamplingAlgorithm extends SamplingAlgorithm { public RandomSamplingAlgorithm() { } + /** + * Get the logbase property: An optional positive number or e in string format to be used as base for log based + * random sampling. + * + * @return the logbase value. + */ + public String logbase() { + return this.logbase; + } + + /** + * Set the logbase property: An optional positive number or e in string format to be used as base for log based + * random sampling. + * + * @param logbase the logbase value to set. + * @return the RandomSamplingAlgorithm object itself. + */ + public RandomSamplingAlgorithm withLogbase(String logbase) { + this.logbase = logbase; + return this; + } + /** * Get the rule property: The specific type of random algorithm. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Ray.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Ray.java new file mode 100644 index 0000000000000..a6894c10f2ebf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Ray.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Ray distribution configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "distributionType") +@JsonTypeName("Ray") +@Fluent +public final class Ray extends DistributionConfiguration { + /* + * The address of Ray head node. + */ + @JsonProperty(value = "address") + private String address; + + /* + * The port to bind the dashboard server to. + */ + @JsonProperty(value = "dashboardPort") + private Integer dashboardPort; + + /* + * Additional arguments passed to ray start in head node. + */ + @JsonProperty(value = "headNodeAdditionalArgs") + private String headNodeAdditionalArgs; + + /* + * Provide this argument to start the Ray dashboard GUI. + */ + @JsonProperty(value = "includeDashboard") + private Boolean includeDashboard; + + /* + * The port of the head ray process. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Additional arguments passed to ray start in worker node. + */ + @JsonProperty(value = "workerNodeAdditionalArgs") + private String workerNodeAdditionalArgs; + + /** Creates an instance of Ray class. */ + public Ray() { + } + + /** + * Get the address property: The address of Ray head node. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The address of Ray head node. + * + * @param address the address value to set. + * @return the Ray object itself. + */ + public Ray withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the dashboardPort property: The port to bind the dashboard server to. + * + * @return the dashboardPort value. + */ + public Integer dashboardPort() { + return this.dashboardPort; + } + + /** + * Set the dashboardPort property: The port to bind the dashboard server to. + * + * @param dashboardPort the dashboardPort value to set. + * @return the Ray object itself. + */ + public Ray withDashboardPort(Integer dashboardPort) { + this.dashboardPort = dashboardPort; + return this; + } + + /** + * Get the headNodeAdditionalArgs property: Additional arguments passed to ray start in head node. + * + * @return the headNodeAdditionalArgs value. + */ + public String headNodeAdditionalArgs() { + return this.headNodeAdditionalArgs; + } + + /** + * Set the headNodeAdditionalArgs property: Additional arguments passed to ray start in head node. + * + * @param headNodeAdditionalArgs the headNodeAdditionalArgs value to set. + * @return the Ray object itself. + */ + public Ray withHeadNodeAdditionalArgs(String headNodeAdditionalArgs) { + this.headNodeAdditionalArgs = headNodeAdditionalArgs; + return this; + } + + /** + * Get the includeDashboard property: Provide this argument to start the Ray dashboard GUI. + * + * @return the includeDashboard value. + */ + public Boolean includeDashboard() { + return this.includeDashboard; + } + + /** + * Set the includeDashboard property: Provide this argument to start the Ray dashboard GUI. + * + * @param includeDashboard the includeDashboard value to set. + * @return the Ray object itself. + */ + public Ray withIncludeDashboard(Boolean includeDashboard) { + this.includeDashboard = includeDashboard; + return this; + } + + /** + * Get the port property: The port of the head ray process. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port of the head ray process. + * + * @param port the port value to set. + * @return the Ray object itself. + */ + public Ray withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the workerNodeAdditionalArgs property: Additional arguments passed to ray start in worker node. + * + * @return the workerNodeAdditionalArgs value. + */ + public String workerNodeAdditionalArgs() { + return this.workerNodeAdditionalArgs; + } + + /** + * Set the workerNodeAdditionalArgs property: Additional arguments passed to ray start in worker node. + * + * @param workerNodeAdditionalArgs the workerNodeAdditionalArgs value to set. + * @return the Ray object itself. + */ + public Ray withWorkerNodeAdditionalArgs(String workerNodeAdditionalArgs) { + this.workerNodeAdditionalArgs = workerNodeAdditionalArgs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java new file mode 100644 index 0000000000000..9eb5125659d0f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The workflow trigger recurrence for ComputeStartStop schedule type. */ +@Fluent +public final class Recurrence { + /* + * [Required] The frequency to trigger schedule. + */ + @JsonProperty(value = "frequency") + private RecurrenceFrequency frequency; + + /* + * [Required] Specifies schedule interval in conjunction with frequency + */ + @JsonProperty(value = "interval") + private Integer interval; + + /* + * The start time in yyyy-MM-ddTHH:mm:ss format. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Specifies time zone in which the schedule runs. + * TimeZone should follow Windows time zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * [Required] The recurrence schedule. + */ + @JsonProperty(value = "schedule") + private RecurrenceSchedule schedule; + + /** Creates an instance of Recurrence class. */ + public Recurrence() { + } + + /** + * Get the frequency property: [Required] The frequency to trigger schedule. + * + * @return the frequency value. + */ + public RecurrenceFrequency frequency() { + return this.frequency; + } + + /** + * Set the frequency property: [Required] The frequency to trigger schedule. + * + * @param frequency the frequency value to set. + * @return the Recurrence object itself. + */ + public Recurrence withFrequency(RecurrenceFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the interval property: [Required] Specifies schedule interval in conjunction with frequency. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: [Required] Specifies schedule interval in conjunction with frequency. + * + * @param interval the interval value to set. + * @return the Recurrence object itself. + */ + public Recurrence withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @param startTime the startTime value to set. + * @return the Recurrence object itself. + */ + public Recurrence withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time + * zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time + * zone format. Refer: + * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11. + * + * @param timeZone the timeZone value to set. + * @return the Recurrence object itself. + */ + public Recurrence withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the schedule property: [Required] The recurrence schedule. + * + * @return the schedule value. + */ + public RecurrenceSchedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: [Required] The recurrence schedule. + * + * @param schedule the schedule value to set. + * @return the Recurrence object itself. + */ + public Recurrence withSchedule(RecurrenceSchedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schedule() != null) { + schedule().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java new file mode 100644 index 0000000000000..84eaec7c23ef3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; + +/** Resource collection API of Registries. */ +public interface Registries { + /** + * List registries by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + Registry getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Get registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Registry getById(String id); + + /** + * Get registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Registry resource. + * + * @param name resource name. + * @return the first stage of the new Registry definition. + */ + Registry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java new file mode 100644 index 0000000000000..b3feb12145abe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Registry. */ +public interface Registry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + String discoveryUrl(); + + /** + * Gets the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + String intellectualPropertyPublisher(); + + /** + * Gets the managedResourceGroup property: ResourceId of the managed RG if the registry has system created + * resources. + * + * @return the managedResourceGroup value. + */ + ArmResourceId managedResourceGroup(); + + /** + * Gets the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + String mlFlowRegistryUri(); + + /** + * Gets the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + List registryPrivateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Is the Registry accessible from the internet? Possible values: "Enabled" + * or "Disabled". + * + * @return the publicNetworkAccess value. + */ + String publicNetworkAccess(); + + /** + * Gets the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + List regionDetails(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner object. + * + * @return the inner object. + */ + RegistryInner innerModel(); + + /** The entirety of the Registry definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The Registry definition stages. */ + interface DefinitionStages { + /** The first stage of the Registry definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the Registry definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** The stage of the Registry definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Registry definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithKind, + DefinitionStages.WithSku, + DefinitionStages.WithDiscoveryUrl, + DefinitionStages.WithIntellectualPropertyPublisher, + DefinitionStages.WithManagedResourceGroup, + DefinitionStages.WithMlFlowRegistryUri, + DefinitionStages.WithRegistryPrivateEndpointConnections, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithRegionDetails { + /** + * Executes the create request. + * + * @return the created resource. + */ + Registry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Registry create(Context context); + } + + /** The stage of the Registry definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the Registry definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** The stage of the Registry definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for + * resources of the same type.. + * + * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the + * same type. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + + /** The stage of the Registry definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + + /** The stage of the Registry definition allowing to specify discoveryUrl. */ + interface WithDiscoveryUrl { + /** + * Specifies the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl Discovery URL for the Registry. + * @return the next definition stage. + */ + WithCreate withDiscoveryUrl(String discoveryUrl); + } + + /** The stage of the Registry definition allowing to specify intellectualPropertyPublisher. */ + interface WithIntellectualPropertyPublisher { + /** + * Specifies the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher IntellectualPropertyPublisher for the registry. + * @return the next definition stage. + */ + WithCreate withIntellectualPropertyPublisher(String intellectualPropertyPublisher); + } + + /** The stage of the Registry definition allowing to specify managedResourceGroup. */ + interface WithManagedResourceGroup { + /** + * Specifies the managedResourceGroup property: ResourceId of the managed RG if the registry has system + * created resources. + * + * @param managedResourceGroup ResourceId of the managed RG if the registry has system created resources. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroup(ArmResourceId managedResourceGroup); + } + + /** The stage of the Registry definition allowing to specify mlFlowRegistryUri. */ + interface WithMlFlowRegistryUri { + /** + * Specifies the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri MLFlow Registry URI for the Registry. + * @return the next definition stage. + */ + WithCreate withMlFlowRegistryUri(String mlFlowRegistryUri); + } + + /** The stage of the Registry definition allowing to specify registryPrivateEndpointConnections. */ + interface WithRegistryPrivateEndpointConnections { + /** + * Specifies the registryPrivateEndpointConnections property: Private endpoint connections info used for + * pending connections in private link portal. + * + * @param registryPrivateEndpointConnections Private endpoint connections info used for pending connections + * in private link portal. + * @return the next definition stage. + */ + WithCreate withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections); + } + + /** The stage of the Registry definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Is the Registry accessible from the internet? Possible + * values: "Enabled" or "Disabled". + * + * @param publicNetworkAccess Is the Registry accessible from the internet? Possible values: "Enabled" or + * "Disabled". + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(String publicNetworkAccess); + } + + /** The stage of the Registry definition allowing to specify regionDetails. */ + interface WithRegionDetails { + /** + * Specifies the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails Details of each region the registry is in. + * @return the next definition stage. + */ + WithCreate withRegionDetails(List regionDetails); + } + } + + /** + * Begins update for the Registry resource. + * + * @return the stage of resource update. + */ + Registry.Update update(); + + /** The template for Registry update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Registry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Registry apply(Context context); + } + + /** The Registry update stages. */ + interface UpdateStages { + /** The stage of the Registry update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the Registry update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(RegistryPartialManagedServiceIdentity identity); + } + + /** The stage of the Registry update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + Update withSku(PartialSku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Registry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Registry refresh(Context context); + + /** + * Remove regions from registry. + * + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(RegistryInner body); + + /** + * Remove regions from registry. + * + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(RegistryInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java new file mode 100644 index 0000000000000..dc521fa5e5d09 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryCodeContainers. */ +public interface RegistryCodeContainers { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + CodeContainer get(String resourceGroupName, String registryName, String codeName); + + /** + * Get Code container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + CodeContainer getById(String id); + + /** + * Get Code container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Code container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Code container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeContainer resource. + * + * @param name resource name. + * @return the first stage of the new CodeContainer definition. + */ + CodeContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java new file mode 100644 index 0000000000000..30336a7a73263 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryCodeVersions. */ +public interface RegistryCodeVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String codeName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String codeName, + String orderBy, + Integer top, + String skip, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + CodeVersion get(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String codeName, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + CodeVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeVersion resource. + * + * @param name resource name. + * @return the first stage of the new CodeVersion definition. + */ + CodeVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java new file mode 100644 index 0000000000000..51f95a4ae8acc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryComponentContainers. */ +public interface RegistryComponentContainers { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + ComponentContainer get(String resourceGroupName, String registryName, String componentName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + ComponentContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComponentContainer resource. + * + * @param name resource name. + * @return the first stage of the new ComponentContainer definition. + */ + ComponentContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java new file mode 100644 index 0000000000000..9f1a2e4b559f2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryComponentVersions. */ +public interface RegistryComponentVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String componentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param stage Component stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String componentName, + String orderBy, + Integer top, + String skip, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + ComponentVersion get(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + ComponentVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComponentVersion resource. + * + * @param name resource name. + * @return the first stage of the new ComponentVersion definition. + */ + ComponentVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java new file mode 100644 index 0000000000000..3fccf1454f85f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryDataContainers. */ +public interface RegistryDataContainers { + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + DataContainer get(String resourceGroupName, String registryName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + DataContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataContainer resource. + * + * @param name resource name. + * @return the first stage of the new DataContainer definition. + */ + DataContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java new file mode 100644 index 0000000000000..34957a2aed037 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryDataVersions. */ +public interface RegistryDataVersions { + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String name); + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top Top count of results, top count cannot be greater than the page size. If topCount > page size, + * results with be default page size count will be returned. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String name, + String orderBy, + Integer top, + String skip, + String tags, + ListViewType listViewType, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + DataVersionBase get(String resourceGroupName, String registryName, String name, String version); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String name, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + DataVersionBase getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataVersionBase resource. + * + * @param name resource name. + * @return the first stage of the new DataVersionBase definition. + */ + DataVersionBase.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java new file mode 100644 index 0000000000000..d26d95522ec15 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryEnvironmentContainers. */ +public interface RegistryEnvironmentContainers { + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + EnvironmentContainer get(String resourceGroupName, String registryName, String environmentName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + EnvironmentContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EnvironmentContainer resource. + * + * @param name resource name. + * @return the first stage of the new EnvironmentContainer definition. + */ + EnvironmentContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java new file mode 100644 index 0000000000000..d21c52cf46b7f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryEnvironmentVersions. */ +public interface RegistryEnvironmentVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String environmentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param stage Stage for including/excluding (for example) archived entities. Takes priority over listViewType. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String environmentName, + String orderBy, + Integer top, + String skip, + ListViewType listViewType, + String stage, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + EnvironmentVersion get(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + EnvironmentVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EnvironmentVersion resource. + * + * @param name resource name. + * @return the first stage of the new EnvironmentVersion definition. + */ + EnvironmentVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java index ada32c54e2e15..e3d6e4ba1e629 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java @@ -12,29 +12,29 @@ @Fluent public final class RegistryListCredentialsResult { /* - * The location property. + * The location of the workspace ACR */ @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; - /* - * The username property. - */ - @JsonProperty(value = "username", access = JsonProperty.Access.WRITE_ONLY) - private String username; - /* * The passwords property. */ @JsonProperty(value = "passwords") private List passwords; + /* + * The username of the workspace ACR + */ + @JsonProperty(value = "username", access = JsonProperty.Access.WRITE_ONLY) + private String username; + /** Creates an instance of RegistryListCredentialsResult class. */ public RegistryListCredentialsResult() { } /** - * Get the location property: The location property. + * Get the location property: The location of the workspace ACR. * * @return the location value. */ @@ -42,15 +42,6 @@ public String location() { return this.location; } - /** - * Get the username property: The username property. - * - * @return the username value. - */ - public String username() { - return this.username; - } - /** * Get the passwords property: The passwords property. * @@ -71,6 +62,15 @@ public RegistryListCredentialsResult withPasswords(List passwords) { return this; } + /** + * Get the username property: The username of the workspace ACR. + * + * @return the username value. + */ + public String username() { + return this.username; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java new file mode 100644 index 0000000000000..1c54f71a0b248 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryModelContainers. */ +public interface RegistryModelContainers { + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String skip, ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + ModelContainer get(String resourceGroupName, String registryName, String modelName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + ModelContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ModelContainer resource. + * + * @param name resource name. + * @return the first stage of the new ModelContainer definition. + */ + ModelContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java new file mode 100644 index 0000000000000..7333c9c12b33b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegistryModelVersions. */ +public interface RegistryModelVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String modelName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String registryName, + String modelName, + String skip, + String orderBy, + Integer top, + String version, + String description, + String tags, + String properties, + ListViewType listViewType, + Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + ModelVersion get(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + PackageResponse packageMethod( + String resourceGroupName, String registryName, String modelName, String version, PackageRequest body); + + /** + * Model Version Package operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Package operation request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return package response returned after async package operation completes successfully. + */ + PackageResponse packageMethod( + String resourceGroupName, + String registryName, + String modelName, + String version, + PackageRequest body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse( + String resourceGroupName, + String registryName, + String modelName, + String version, + PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + ModelVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ModelVersion resource. + * + * @param name resource name. + * @return the first stage of the new ModelVersion definition. + */ + ModelVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java new file mode 100644 index 0000000000000..47e063fb9a6e1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public final class RegistryPartialManagedServiceIdentity extends ManagedServiceIdentity { + /** Creates an instance of RegistryPartialManagedServiceIdentity class. */ + public RegistryPartialManagedServiceIdentity() { + } + + /** {@inheritDoc} */ + @Override + public RegistryPartialManagedServiceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryPartialManagedServiceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java new file mode 100644 index 0000000000000..bf5fb5ea9418e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryPrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private endpoint connection definition. */ +@Fluent +public final class RegistryPrivateEndpointConnection { + /* + * This is the private endpoint connection name created on SRP + * Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} + */ + @JsonProperty(value = "id") + private String id; + + /* + * Same as workspace location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Properties of the Private Endpoint Connection + */ + @JsonProperty(value = "properties") + private RegistryPrivateEndpointConnectionProperties innerProperties; + + /** Creates an instance of RegistryPrivateEndpointConnection class. */ + public RegistryPrivateEndpointConnection() { + } + + /** + * Get the id property: This is the private endpoint connection name created on SRP Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: This is the private endpoint connection name created on SRP Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. + * + * @param id the id value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withId(String id) { + this.id = id; + return this; + } + + /** + * Get the location property: Same as workspace location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Same as workspace location. + * + * @param location the location value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Properties of the Private Endpoint Connection. + * + * @return the innerProperties value. + */ + private RegistryPrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupIds property: The group ids. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Set the groupIds property: The group ids. + * + * @param groupIds the groupIds value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withGroupIds(List groupIds) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withGroupIds(groupIds); + return this; + } + + /** + * Get the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointResource privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withPrivateEndpoint(PrivateEndpointResource privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @return the registryPrivateLinkServiceConnectionState value. + */ + public RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState() { + return this.innerProperties() == null + ? null + : this.innerProperties().registryPrivateLinkServiceConnectionState(); + } + + /** + * Set the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @param registryPrivateLinkServiceConnectionState the registryPrivateLinkServiceConnectionState value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withRegistryPrivateLinkServiceConnectionState( + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withRegistryPrivateLinkServiceConnectionState(registryPrivateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @param provisioningState the provisioningState value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..246fa3e53848e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The connection state. */ +@Fluent +public final class RegistryPrivateLinkServiceConnectionState { + /* + * Some RP chose "None". Other RPs use this for region expansion. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /* + * User-defined message that, per NRP doc, may be used for approval-related message. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Connection status of the service consumer with the service provider + */ + @JsonProperty(value = "status") + private EndpointServiceConnectionStatus status; + + /** Creates an instance of RegistryPrivateLinkServiceConnectionState class. */ + public RegistryPrivateLinkServiceConnectionState() { + } + + /** + * Get the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. + * + * @param actionsRequired the actionsRequired value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Get the description property: User-defined message that, per NRP doc, may be used for approval-related message. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-defined message that, per NRP doc, may be used for approval-related message. + * + * @param description the description value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Connection status of the service consumer with the service provider. + * + * @return the status value. + */ + public EndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Connection status of the service consumer with the service provider. + * + * @param status the status value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withStatus(EndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java new file mode 100644 index 0000000000000..3be9195b27153 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details for each region the registry is in. */ +@Fluent +public final class RegistryRegionArmDetails { + /* + * List of ACR accounts + */ + @JsonProperty(value = "acrDetails") + private List acrDetails; + + /* + * The location where the registry exists + */ + @JsonProperty(value = "location") + private String location; + + /* + * List of storage accounts + */ + @JsonProperty(value = "storageAccountDetails") + private List storageAccountDetails; + + /** Creates an instance of RegistryRegionArmDetails class. */ + public RegistryRegionArmDetails() { + } + + /** + * Get the acrDetails property: List of ACR accounts. + * + * @return the acrDetails value. + */ + public List acrDetails() { + return this.acrDetails; + } + + /** + * Set the acrDetails property: List of ACR accounts. + * + * @param acrDetails the acrDetails value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withAcrDetails(List acrDetails) { + this.acrDetails = acrDetails; + return this; + } + + /** + * Get the location property: The location where the registry exists. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location where the registry exists. + * + * @param location the location value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the storageAccountDetails property: List of storage accounts. + * + * @return the storageAccountDetails value. + */ + public List storageAccountDetails() { + return this.storageAccountDetails; + } + + /** + * Set the storageAccountDetails property: List of storage accounts. + * + * @param storageAccountDetails the storageAccountDetails value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withStorageAccountDetails(List storageAccountDetails) { + this.storageAccountDetails = storageAccountDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (acrDetails() != null) { + acrDetails().forEach(e -> e.validate()); + } + if (storageAccountDetails() != null) { + storageAccountDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..a37b57eb6d41e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paginated list of Registry entities. */ +@Fluent +public final class RegistryTrackedResourceArmPaginatedResult { + /* + * The link to the next page of Registry objects. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * An array of objects of type Registry. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RegistryTrackedResourceArmPaginatedResult class. */ + public RegistryTrackedResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Registry objects. If null, there are no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of Registry objects. If null, there are no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the RegistryTrackedResourceArmPaginatedResult object itself. + */ + public RegistryTrackedResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type Registry. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type Registry. + * + * @param value the value value to set. + * @return the RegistryTrackedResourceArmPaginatedResult object itself. + */ + public RegistryTrackedResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java index 40ed6fd905bf6..451b66c605f22 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java @@ -39,6 +39,12 @@ public final class Regression extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private TableFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @@ -52,6 +58,18 @@ public final class Regression extends AutoMLVertical { @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private TableSweepSettings sweepSettings; + /* * Test data input. */ @@ -171,6 +189,26 @@ public Regression withFeaturizationSettings(TableVerticalFeaturizationSettings f return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public TableFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the Regression object itself. + */ + public Regression withFixedParameters(TableFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -213,6 +251,48 @@ public Regression withNCrossValidations(NCrossValidations nCrossValidations) { return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the Regression object itself. + */ + public Regression withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public TableSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the Regression object itself. + */ + public Regression withSweepSettings(TableSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the testData property: Test data input. * @@ -354,12 +434,21 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } if (nCrossValidations() != null) { nCrossValidations().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (testData() != null) { testData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetric.java new file mode 100644 index 0000000000000..aaf8cba0d3802 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetric.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegressionModelPerformanceMetric. */ +public final class RegressionModelPerformanceMetric extends ExpandableStringEnum { + /** Static value MeanAbsoluteError for RegressionModelPerformanceMetric. */ + public static final RegressionModelPerformanceMetric MEAN_ABSOLUTE_ERROR = fromString("MeanAbsoluteError"); + + /** Static value RootMeanSquaredError for RegressionModelPerformanceMetric. */ + public static final RegressionModelPerformanceMetric ROOT_MEAN_SQUARED_ERROR = fromString("RootMeanSquaredError"); + + /** Static value MeanSquaredError for RegressionModelPerformanceMetric. */ + public static final RegressionModelPerformanceMetric MEAN_SQUARED_ERROR = fromString("MeanSquaredError"); + + /** + * Creates a new instance of RegressionModelPerformanceMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RegressionModelPerformanceMetric() { + } + + /** + * Creates or finds a RegressionModelPerformanceMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegressionModelPerformanceMetric. + */ + @JsonCreator + public static RegressionModelPerformanceMetric fromString(String name) { + return fromString(name, RegressionModelPerformanceMetric.class); + } + + /** + * Gets known RegressionModelPerformanceMetric values. + * + * @return known RegressionModelPerformanceMetric values. + */ + public static Collection values() { + return values(RegressionModelPerformanceMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetricThreshold.java new file mode 100644 index 0000000000000..0d3b095112bed --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModelPerformanceMetricThreshold.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The RegressionModelPerformanceMetricThreshold model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "modelType") +@JsonTypeName("Regression") +@Fluent +public final class RegressionModelPerformanceMetricThreshold extends ModelPerformanceMetricThresholdBase { + /* + * [Required] The regression model performance metric to calculate. + */ + @JsonProperty(value = "metric", required = true) + private RegressionModelPerformanceMetric metric; + + /** Creates an instance of RegressionModelPerformanceMetricThreshold class. */ + public RegressionModelPerformanceMetricThreshold() { + } + + /** + * Get the metric property: [Required] The regression model performance metric to calculate. + * + * @return the metric value. + */ + public RegressionModelPerformanceMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The regression model performance metric to calculate. + * + * @param metric the metric value to set. + * @return the RegressionModelPerformanceMetricThreshold object itself. + */ + public RegressionModelPerformanceMetricThreshold withMetric(RegressionModelPerformanceMetric metric) { + this.metric = metric; + return this; + } + + /** {@inheritDoc} */ + @Override + public RegressionModelPerformanceMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metric in model RegressionModelPerformanceMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegressionModelPerformanceMetricThreshold.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java index 289a03ff56409..1b3d89b7170f2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java @@ -117,6 +117,13 @@ public RegressionTrainingSettings withStackEnsembleSettings(StackEnsembleSetting return this; } + /** {@inheritDoc} */ + @Override + public RegressionTrainingSettings withTrainingMode(TrainingMode trainingMode) { + super.withTrainingMode(trainingMode); + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java new file mode 100644 index 0000000000000..00e10c9af2c1a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RequestLogging model. */ +@Fluent +public final class RequestLogging { + /* + * For payload logging, we only collect payload by default. If customers also want to collect the specified + * headers, they can set them in captureHeaders so that backend will collect those headers along with payload. + */ + @JsonProperty(value = "captureHeaders") + private List captureHeaders; + + /** Creates an instance of RequestLogging class. */ + public RequestLogging() { + } + + /** + * Get the captureHeaders property: For payload logging, we only collect payload by default. If customers also want + * to collect the specified headers, they can set them in captureHeaders so that backend will collect those headers + * along with payload. + * + * @return the captureHeaders value. + */ + public List captureHeaders() { + return this.captureHeaders; + } + + /** + * Set the captureHeaders property: For payload logging, we only collect payload by default. If customers also want + * to collect the specified headers, they can set them in captureHeaders so that backend will collect those headers + * along with payload. + * + * @param captureHeaders the captureHeaders value to set. + * @return the RequestLogging object itself. + */ + public RequestLogging withCaptureHeaders(List captureHeaders) { + this.captureHeaders = captureHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResizeSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResizeSchema.java new file mode 100644 index 0000000000000..b317abe84c175 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResizeSchema.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Schema for Compute Instance resize. */ +@Fluent +public final class ResizeSchema { + /* + * The name of the virtual machine size. + */ + @JsonProperty(value = "targetVMSize") + private String targetVMSize; + + /** Creates an instance of ResizeSchema class. */ + public ResizeSchema() { + } + + /** + * Get the targetVMSize property: The name of the virtual machine size. + * + * @return the targetVMSize value. + */ + public String targetVMSize() { + return this.targetVMSize; + } + + /** + * Set the targetVMSize property: The name of the virtual machine size. + * + * @param targetVMSize the targetVMSize value to set. + * @return the ResizeSchema object itself. + */ + public ResizeSchema withTargetVMSize(String targetVMSize) { + this.targetVMSize = targetVMSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java index 01067c5f7380f..f2575a1a57901 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** The ResourceConfiguration model. */ @@ -24,6 +25,19 @@ public class ResourceConfiguration { @JsonProperty(value = "instanceType") private String instanceType; + /* + * Locations where the job can run. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Optional max allowed number of instances or nodes to be used by the compute target. + * For use with elastic training, currently supported by PyTorch distribution type only. + */ + @JsonProperty(value = "maxInstanceCount") + private Integer maxInstanceCount; + /* * Additional properties bag. */ @@ -75,6 +89,48 @@ public ResourceConfiguration withInstanceType(String instanceType) { return this; } + /** + * Get the locations property: Locations where the job can run. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Locations where the job can run. + * + * @param locations the locations value to set. + * @return the ResourceConfiguration object itself. + */ + public ResourceConfiguration withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the maxInstanceCount property: Optional max allowed number of instances or nodes to be used by the compute + * target. For use with elastic training, currently supported by PyTorch distribution type only. + * + * @return the maxInstanceCount value. + */ + public Integer maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set the maxInstanceCount property: Optional max allowed number of instances or nodes to be used by the compute + * target. For use with elastic training, currently supported by PyTorch distribution type only. + * + * @param maxInstanceCount the maxInstanceCount value to set. + * @return the ResourceConfiguration object itself. + */ + public ResourceConfiguration withMaxInstanceCount(Integer maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + /** * Get the properties property: Additional properties bag. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java new file mode 100644 index 0000000000000..10ba1999a91e1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RollingRateType. */ +public final class RollingRateType extends ExpandableStringEnum { + /** Static value Year for RollingRateType. */ + public static final RollingRateType YEAR = fromString("Year"); + + /** Static value Month for RollingRateType. */ + public static final RollingRateType MONTH = fromString("Month"); + + /** Static value Day for RollingRateType. */ + public static final RollingRateType DAY = fromString("Day"); + + /** Static value Hour for RollingRateType. */ + public static final RollingRateType HOUR = fromString("Hour"); + + /** Static value Minute for RollingRateType. */ + public static final RollingRateType MINUTE = fromString("Minute"); + + /** + * Creates a new instance of RollingRateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RollingRateType() { + } + + /** + * Creates or finds a RollingRateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RollingRateType. + */ + @JsonCreator + public static RollingRateType fromString(String name) { + return fromString(name, RollingRateType.class); + } + + /** + * Gets known RollingRateType values. + * + * @return known RollingRateType values. + */ + public static Collection values() { + return values(RollingRateType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java new file mode 100644 index 0000000000000..06c12d0ac675b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The action enum for networking rule. */ +public final class RuleAction extends ExpandableStringEnum { + /** Static value Allow for RuleAction. */ + public static final RuleAction ALLOW = fromString("Allow"); + + /** Static value Deny for RuleAction. */ + public static final RuleAction DENY = fromString("Deny"); + + /** + * Creates a new instance of RuleAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleAction() { + } + + /** + * Creates or finds a RuleAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleAction. + */ + @JsonCreator + public static RuleAction fromString(String name) { + return fromString(name, RuleAction.class); + } + + /** + * Gets known RuleAction values. + * + * @return known RuleAction values. + */ + public static Collection values() { + return values(RuleAction.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java new file mode 100644 index 0000000000000..86ef6d8a2659d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Category of a managed network Outbound Rule of a machine learning workspace. */ +public final class RuleCategory extends ExpandableStringEnum { + /** Static value Required for RuleCategory. */ + public static final RuleCategory REQUIRED = fromString("Required"); + + /** Static value Recommended for RuleCategory. */ + public static final RuleCategory RECOMMENDED = fromString("Recommended"); + + /** Static value UserDefined for RuleCategory. */ + public static final RuleCategory USER_DEFINED = fromString("UserDefined"); + + /** + * Creates a new instance of RuleCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleCategory() { + } + + /** + * Creates or finds a RuleCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCategory. + */ + @JsonCreator + public static RuleCategory fromString(String name) { + return fromString(name, RuleCategory.class); + } + + /** + * Gets known RuleCategory values. + * + * @return known RuleCategory values. + */ + public static Collection values() { + return values(RuleCategory.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java new file mode 100644 index 0000000000000..df21146129af6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of a managed network Outbound Rule of a machine learning workspace. */ +public final class RuleStatus extends ExpandableStringEnum { + /** Static value Inactive for RuleStatus. */ + public static final RuleStatus INACTIVE = fromString("Inactive"); + + /** Static value Active for RuleStatus. */ + public static final RuleStatus ACTIVE = fromString("Active"); + + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + + /** + * Creates or finds a RuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleStatus. + */ + @JsonCreator + public static RuleStatus fromString(String name) { + return fromString(name, RuleStatus.class); + } + + /** + * Gets known RuleStatus values. + * + * @return known RuleStatus values. + */ + public static Collection values() { + return values(RuleStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java new file mode 100644 index 0000000000000..3d24ede6d6eb2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of a managed network Outbound Rule of a machine learning workspace. */ +public final class RuleType extends ExpandableStringEnum { + /** Static value FQDN for RuleType. */ + public static final RuleType FQDN = fromString("FQDN"); + + /** Static value PrivateEndpoint for RuleType. */ + public static final RuleType PRIVATE_ENDPOINT = fromString("PrivateEndpoint"); + + /** Static value ServiceTag for RuleType. */ + public static final RuleType SERVICE_TAG = fromString("ServiceTag"); + + /** + * Creates a new instance of RuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleType() { + } + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + @JsonCreator + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** + * Gets known RuleType values. + * + * @return known RuleType values. + */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java index 1065fa7947c69..025836fb0c236 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The SasAuthTypeWorkspaceConnectionProperties model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -54,22 +55,22 @@ public SasAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory /** {@inheritDoc} */ @Override - public SasAuthTypeWorkspaceConnectionProperties withTarget(String target) { - super.withTarget(target); + public SasAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); return this; } /** {@inheritDoc} */ @Override - public SasAuthTypeWorkspaceConnectionProperties withValue(String value) { - super.withValue(value); + public SasAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); return this; } /** {@inheritDoc} */ @Override - public SasAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { - super.withValueFormat(valueFormat); + public SasAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java new file mode 100644 index 0000000000000..65cb3099c524b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SasCredentialDto model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialType") +@JsonTypeName("SAS") +@Fluent +public final class SasCredentialDto extends PendingUploadCredentialDto { + /* + * Full SAS Uri, including the storage, container/blob path and SAS token + */ + @JsonProperty(value = "sasUri") + private String sasUri; + + /** Creates an instance of SasCredentialDto class. */ + public SasCredentialDto() { + } + + /** + * Get the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @return the sasUri value. + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @param sasUri the sasUri value to set. + * @return the SasCredentialDto object itself. + */ + public SasCredentialDto withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java index 81edf1559396e..26f73fca2b2b7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java @@ -18,7 +18,7 @@ public final class SasDatastoreCredentials extends DatastoreCredentials { /* * [Required] Storage container secrets. */ - @JsonProperty(value = "secrets", required = true) + @JsonProperty(value = "secrets") private SasDatastoreSecrets secrets; /** Creates an instance of SasDatastoreCredentials class. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java index 7808d864dab94..9d41495441afc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java @@ -66,11 +66,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The Schedule definition stages. */ interface DefinitionStages { /** The first stage of the Schedule definition. */ interface Blank extends WithParentResource { } + /** The stage of the Schedule definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -82,6 +84,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the Schedule definition allowing to specify properties. */ interface WithProperties { /** @@ -92,6 +95,7 @@ interface WithProperties { */ WithCreate withProperties(ScheduleProperties properties); } + /** * The stage of the Schedule definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -113,6 +117,7 @@ interface WithCreate { Schedule create(Context context); } } + /** * Begins update for the Schedule resource. * @@ -137,6 +142,7 @@ interface Update extends UpdateStages.WithProperties { */ Schedule apply(Context context); } + /** The Schedule update stages. */ interface UpdateStages { /** The stage of the Schedule update allowing to specify properties. */ @@ -150,6 +156,7 @@ interface WithProperties { Update withProperties(ScheduleProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java index d88932a1d1c21..50c2890279746 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java @@ -17,7 +17,9 @@ defaultImpl = ScheduleActionBase.class) @JsonTypeName("ScheduleActionBase") @JsonSubTypes({ + @JsonSubTypes.Type(name = "CreateMonitor", value = CreateMonitorAction.class), @JsonSubTypes.Type(name = "InvokeBatchEndpoint", value = EndpointScheduleAction.class), + @JsonSubTypes.Type(name = "ImportData", value = ImportDataAction.class), @JsonSubTypes.Type(name = "CreateJob", value = JobScheduleAction.class) }) @Immutable diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java index 24fe002c87045..c8879c3b7d878 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java @@ -16,6 +16,12 @@ public final class ScheduleActionType extends ExpandableStringEnum { /** Static value ServicePrincipal for SecretsType. */ public static final SecretsType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + /** Static value KerberosPassword for SecretsType. */ + public static final SecretsType KERBEROS_PASSWORD = fromString("KerberosPassword"); + + /** Static value KerberosKeytab for SecretsType. */ + public static final SecretsType KERBEROS_KEYTAB = fromString("KerberosKeytab"); + /** * Creates a new instance of SecretsType value. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java index aceabf00a371f..00e8e9c8c9ae4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java @@ -11,7 +11,7 @@ @Fluent public final class ServiceManagedResourcesSettings { /* - * The settings for the service managed cosmosdb account. + * The cosmosDb property. */ @JsonProperty(value = "cosmosDb") private CosmosDbSettings cosmosDb; @@ -21,7 +21,7 @@ public ServiceManagedResourcesSettings() { } /** - * Get the cosmosDb property: The settings for the service managed cosmosdb account. + * Get the cosmosDb property: The cosmosDb property. * * @return the cosmosDb value. */ @@ -30,7 +30,7 @@ public CosmosDbSettings cosmosDb() { } /** - * Set the cosmosDb property: The settings for the service managed cosmosdb account. + * Set the cosmosDb property: The cosmosDb property. * * @param cosmosDb the cosmosDb value to set. * @return the ServiceManagedResourcesSettings object itself. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..eab4c7c206ae0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The ServicePrincipalAuthTypeWorkspaceConnectionProperties model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("ServicePrincipal") +@Fluent +public final class ServicePrincipalAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * The credentials property. + */ + @JsonProperty(value = "credentials") + private WorkspaceConnectionServicePrincipal credentials; + + /** Creates an instance of ServicePrincipalAuthTypeWorkspaceConnectionProperties class. */ + public ServicePrincipalAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public WorkspaceConnectionServicePrincipal credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the ServicePrincipalAuthTypeWorkspaceConnectionProperties object itself. + */ + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withCredentials( + WorkspaceConnectionServicePrincipal credentials) { + this.credentials = credentials; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java index f8898ec7e7449..6edc1f46ca82a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java @@ -37,7 +37,7 @@ public final class ServicePrincipalDatastoreCredentials extends DatastoreCredent /* * [Required] Service principal secrets. */ - @JsonProperty(value = "secrets", required = true) + @JsonProperty(value = "secrets") private ServicePrincipalDatastoreSecrets secrets; /* diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java new file mode 100644 index 0000000000000..a7da08142c518 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. */ +@Fluent +public final class ServiceTagDestination { + /* + * The action enum for networking rule. + */ + @JsonProperty(value = "action") + private RuleAction action; + + /* + * Optional, if provided, the ServiceTag property will be ignored. + */ + @JsonProperty(value = "addressPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List addressPrefixes; + + /* + * The portRanges property. + */ + @JsonProperty(value = "portRanges") + private String portRanges; + + /* + * The protocol property. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * The serviceTag property. + */ + @JsonProperty(value = "serviceTag") + private String serviceTag; + + /** Creates an instance of ServiceTagDestination class. */ + public ServiceTagDestination() { + } + + /** + * Get the action property: The action enum for networking rule. + * + * @return the action value. + */ + public RuleAction action() { + return this.action; + } + + /** + * Set the action property: The action enum for networking rule. + * + * @param action the action value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withAction(RuleAction action) { + this.action = action; + return this; + } + + /** + * Get the addressPrefixes property: Optional, if provided, the ServiceTag property will be ignored. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the portRanges property: The portRanges property. + * + * @return the portRanges value. + */ + public String portRanges() { + return this.portRanges; + } + + /** + * Set the portRanges property: The portRanges property. + * + * @param portRanges the portRanges value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withPortRanges(String portRanges) { + this.portRanges = portRanges; + return this; + } + + /** + * Get the protocol property: The protocol property. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol property. + * + * @param protocol the protocol value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the serviceTag property: The serviceTag property. + * + * @return the serviceTag value. + */ + public String serviceTag() { + return this.serviceTag; + } + + /** + * Set the serviceTag property: The serviceTag property. + * + * @param serviceTag the serviceTag value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withServiceTag(String serviceTag) { + this.serviceTag = serviceTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java new file mode 100644 index 0000000000000..3cd7688bc80a5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Service Tag Outbound Rule for the managed network of a machine learning workspace. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ServiceTag") +@Fluent +public final class ServiceTagOutboundRule extends OutboundRule { + /* + * Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + */ + @JsonProperty(value = "destination") + private ServiceTagDestination destination; + + /** Creates an instance of ServiceTagOutboundRule class. */ + public ServiceTagOutboundRule() { + } + + /** + * Get the destination property: Service Tag destination for a Service Tag Outbound Rule for the managed network of + * a machine learning workspace. + * + * @return the destination value. + */ + public ServiceTagDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Service Tag destination for a Service Tag Outbound Rule for the managed network of + * a machine learning workspace. + * + * @param destination the destination value to set. + * @return the ServiceTagOutboundRule object itself. + */ + public ServiceTagOutboundRule withDestination(ServiceTagDestination destination) { + this.destination = destination; + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceTagOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceTagOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (destination() != null) { + destination().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java index 46ec2f251384d..0c1229955f209 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java @@ -12,13 +12,13 @@ @Fluent public final class SharedPrivateLinkResource { /* - * Unique name of the private link. + * Unique name of the private link */ @JsonProperty(value = "name") private String name; /* - * Resource properties. + * Properties of a shared private link resource. */ @JsonProperty(value = "properties") private SharedPrivateLinkResourceProperty innerProperties; @@ -48,7 +48,7 @@ public SharedPrivateLinkResource withName(String name) { } /** - * Get the innerProperties property: Resource properties. + * Get the innerProperties property: Properties of a shared private link resource. * * @return the innerProperties value. */ @@ -57,48 +57,48 @@ private SharedPrivateLinkResourceProperty innerProperties() { } /** - * Get the privateLinkResourceId property: The resource id that private link links to. + * Get the groupId property: group id of the private link. * - * @return the privateLinkResourceId value. + * @return the groupId value. */ - public String privateLinkResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); } /** - * Set the privateLinkResourceId property: The resource id that private link links to. + * Set the groupId property: group id of the private link. * - * @param privateLinkResourceId the privateLinkResourceId value to set. + * @param groupId the groupId value to set. * @return the SharedPrivateLinkResource object itself. */ - public SharedPrivateLinkResource withPrivateLinkResourceId(String privateLinkResourceId) { + public SharedPrivateLinkResource withGroupId(String groupId) { if (this.innerProperties() == null) { this.innerProperties = new SharedPrivateLinkResourceProperty(); } - this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + this.innerProperties().withGroupId(groupId); return this; } /** - * Get the groupId property: The private link resource group id. + * Get the privateLinkResourceId property: the resource id that private link links to. * - * @return the groupId value. + * @return the privateLinkResourceId value. */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); } /** - * Set the groupId property: The private link resource group id. + * Set the privateLinkResourceId property: the resource id that private link links to. * - * @param groupId the groupId value to set. + * @param privateLinkResourceId the privateLinkResourceId value to set. * @return the SharedPrivateLinkResource object itself. */ - public SharedPrivateLinkResource withGroupId(String groupId) { + public SharedPrivateLinkResource withPrivateLinkResourceId(String privateLinkResourceId) { if (this.innerProperties() == null) { this.innerProperties = new SharedPrivateLinkResourceProperty(); } - this.innerProperties().withGroupId(groupId); + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); return this; } @@ -126,23 +126,21 @@ public SharedPrivateLinkResource withRequestMessage(String requestMessage) { } /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Get the status property: Connection status of the service consumer with the service provider. * * @return the status value. */ - public PrivateEndpointServiceConnectionStatus status() { + public EndpointServiceConnectionStatus status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. + * Set the status property: Connection status of the service consumer with the service provider. * * @param status the status value to set. * @return the SharedPrivateLinkResource object itself. */ - public SharedPrivateLinkResource withStatus(PrivateEndpointServiceConnectionStatus status) { + public SharedPrivateLinkResource withStatus(EndpointServiceConnectionStatus status) { if (this.innerProperties() == null) { this.innerProperties = new SharedPrivateLinkResourceProperty(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java new file mode 100644 index 0000000000000..f9c253c8563a3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Spark job definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("Spark") +@Fluent +public final class SparkJob extends JobBaseProperties { + /* + * Archive files used in the job. + */ + @JsonProperty(value = "archives") + private List archives; + + /* + * Arguments for the job. + */ + @JsonProperty(value = "args") + private String args; + + /* + * [Required] ARM resource ID of the code asset. + */ + @JsonProperty(value = "codeId", required = true) + private String codeId; + + /* + * Spark configured properties. + */ + @JsonProperty(value = "conf") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map conf; + + /* + * [Required] The entry to execute on startup of the job. + */ + @JsonProperty(value = "entry", required = true) + private SparkJobEntry entry; + + /* + * The ARM resource ID of the Environment specification for the job. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * Files used in the job. + */ + @JsonProperty(value = "files") + private List files; + + /* + * Mapping of input data bindings used in the job. + */ + @JsonProperty(value = "inputs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map inputs; + + /* + * Jar files used in the job. + */ + @JsonProperty(value = "jars") + private List jars; + + /* + * Mapping of output data bindings used in the job. + */ + @JsonProperty(value = "outputs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map outputs; + + /* + * Python files used in the job. + */ + @JsonProperty(value = "pyFiles") + private List pyFiles; + + /* + * Queue settings for the job + */ + @JsonProperty(value = "queueSettings") + private QueueSettings queueSettings; + + /* + * Compute Resource configuration for the job. + */ + @JsonProperty(value = "resources") + private SparkResourceConfiguration resources; + + /** Creates an instance of SparkJob class. */ + public SparkJob() { + } + + /** + * Get the archives property: Archive files used in the job. + * + * @return the archives value. + */ + public List archives() { + return this.archives; + } + + /** + * Set the archives property: Archive files used in the job. + * + * @param archives the archives value to set. + * @return the SparkJob object itself. + */ + public SparkJob withArchives(List archives) { + this.archives = archives; + return this; + } + + /** + * Get the args property: Arguments for the job. + * + * @return the args value. + */ + public String args() { + return this.args; + } + + /** + * Set the args property: Arguments for the job. + * + * @param args the args value to set. + * @return the SparkJob object itself. + */ + public SparkJob withArgs(String args) { + this.args = args; + return this; + } + + /** + * Get the codeId property: [Required] ARM resource ID of the code asset. + * + * @return the codeId value. + */ + public String codeId() { + return this.codeId; + } + + /** + * Set the codeId property: [Required] ARM resource ID of the code asset. + * + * @param codeId the codeId value to set. + * @return the SparkJob object itself. + */ + public SparkJob withCodeId(String codeId) { + this.codeId = codeId; + return this; + } + + /** + * Get the conf property: Spark configured properties. + * + * @return the conf value. + */ + public Map conf() { + return this.conf; + } + + /** + * Set the conf property: Spark configured properties. + * + * @param conf the conf value to set. + * @return the SparkJob object itself. + */ + public SparkJob withConf(Map conf) { + this.conf = conf; + return this; + } + + /** + * Get the entry property: [Required] The entry to execute on startup of the job. + * + * @return the entry value. + */ + public SparkJobEntry entry() { + return this.entry; + } + + /** + * Set the entry property: [Required] The entry to execute on startup of the job. + * + * @param entry the entry value to set. + * @return the SparkJob object itself. + */ + public SparkJob withEntry(SparkJobEntry entry) { + this.entry = entry; + return this; + } + + /** + * Get the environmentId property: The ARM resource ID of the Environment specification for the job. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The ARM resource ID of the Environment specification for the job. + * + * @param environmentId the environmentId value to set. + * @return the SparkJob object itself. + */ + public SparkJob withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the files property: Files used in the job. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: Files used in the job. + * + * @param files the files value to set. + * @return the SparkJob object itself. + */ + public SparkJob withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the inputs property: Mapping of input data bindings used in the job. + * + * @return the inputs value. + */ + public Map inputs() { + return this.inputs; + } + + /** + * Set the inputs property: Mapping of input data bindings used in the job. + * + * @param inputs the inputs value to set. + * @return the SparkJob object itself. + */ + public SparkJob withInputs(Map inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the jars property: Jar files used in the job. + * + * @return the jars value. + */ + public List jars() { + return this.jars; + } + + /** + * Set the jars property: Jar files used in the job. + * + * @param jars the jars value to set. + * @return the SparkJob object itself. + */ + public SparkJob withJars(List jars) { + this.jars = jars; + return this; + } + + /** + * Get the outputs property: Mapping of output data bindings used in the job. + * + * @return the outputs value. + */ + public Map outputs() { + return this.outputs; + } + + /** + * Set the outputs property: Mapping of output data bindings used in the job. + * + * @param outputs the outputs value to set. + * @return the SparkJob object itself. + */ + public SparkJob withOutputs(Map outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the pyFiles property: Python files used in the job. + * + * @return the pyFiles value. + */ + public List pyFiles() { + return this.pyFiles; + } + + /** + * Set the pyFiles property: Python files used in the job. + * + * @param pyFiles the pyFiles value to set. + * @return the SparkJob object itself. + */ + public SparkJob withPyFiles(List pyFiles) { + this.pyFiles = pyFiles; + return this; + } + + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the SparkJob object itself. + */ + public SparkJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + + /** + * Get the resources property: Compute Resource configuration for the job. + * + * @return the resources value. + */ + public SparkResourceConfiguration resources() { + return this.resources; + } + + /** + * Set the resources property: Compute Resource configuration for the job. + * + * @param resources the resources value to set. + * @return the SparkJob object itself. + */ + public SparkJob withResources(SparkResourceConfiguration resources) { + this.resources = resources; + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withComponentId(String componentId) { + super.withComponentId(componentId); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withComputeId(String computeId) { + super.withComputeId(computeId); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withExperimentName(String experimentName) { + super.withExperimentName(experimentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withIdentity(IdentityConfiguration identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withServices(Map services) { + super.withServices(services); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public SparkJob withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (codeId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property codeId in model SparkJob")); + } + if (entry() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property entry in model SparkJob")); + } else { + entry().validate(); + } + if (inputs() != null) { + inputs() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (outputs() != null) { + outputs() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (queueSettings() != null) { + queueSettings().validate(); + } + if (resources() != null) { + resources().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJob.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java new file mode 100644 index 0000000000000..e90affce31519 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Spark job entry point definition. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "sparkJobEntryType", + defaultImpl = SparkJobEntry.class) +@JsonTypeName("SparkJobEntry") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SparkJobPythonEntry", value = SparkJobPythonEntry.class), + @JsonSubTypes.Type(name = "SparkJobScalaEntry", value = SparkJobScalaEntry.class) +}) +@Immutable +public class SparkJobEntry { + /** Creates an instance of SparkJobEntry class. */ + public SparkJobEntry() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java new file mode 100644 index 0000000000000..f543436659f08 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SparkJobEntryType. */ +public final class SparkJobEntryType extends ExpandableStringEnum { + /** Static value SparkJobPythonEntry for SparkJobEntryType. */ + public static final SparkJobEntryType SPARK_JOB_PYTHON_ENTRY = fromString("SparkJobPythonEntry"); + + /** Static value SparkJobScalaEntry for SparkJobEntryType. */ + public static final SparkJobEntryType SPARK_JOB_SCALA_ENTRY = fromString("SparkJobScalaEntry"); + + /** + * Creates a new instance of SparkJobEntryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SparkJobEntryType() { + } + + /** + * Creates or finds a SparkJobEntryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SparkJobEntryType. + */ + @JsonCreator + public static SparkJobEntryType fromString(String name) { + return fromString(name, SparkJobEntryType.class); + } + + /** + * Gets known SparkJobEntryType values. + * + * @return known SparkJobEntryType values. + */ + public static Collection values() { + return values(SparkJobEntryType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java new file mode 100644 index 0000000000000..b0ef4d88bd190 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SparkJobPythonEntry model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "sparkJobEntryType") +@JsonTypeName("SparkJobPythonEntry") +@Fluent +public final class SparkJobPythonEntry extends SparkJobEntry { + /* + * [Required] Relative python file path for job entry point. + */ + @JsonProperty(value = "file", required = true) + private String file; + + /** Creates an instance of SparkJobPythonEntry class. */ + public SparkJobPythonEntry() { + } + + /** + * Get the file property: [Required] Relative python file path for job entry point. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Set the file property: [Required] Relative python file path for job entry point. + * + * @param file the file value to set. + * @return the SparkJobPythonEntry object itself. + */ + public SparkJobPythonEntry withFile(String file) { + this.file = file; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (file() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property file in model SparkJobPythonEntry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJobPythonEntry.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java new file mode 100644 index 0000000000000..f05cabc80e9ab --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SparkJobScalaEntry model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "sparkJobEntryType") +@JsonTypeName("SparkJobScalaEntry") +@Fluent +public final class SparkJobScalaEntry extends SparkJobEntry { + /* + * [Required] Scala class name used as entry point. + */ + @JsonProperty(value = "className", required = true) + private String className; + + /** Creates an instance of SparkJobScalaEntry class. */ + public SparkJobScalaEntry() { + } + + /** + * Get the className property: [Required] Scala class name used as entry point. + * + * @return the className value. + */ + public String className() { + return this.className; + } + + /** + * Set the className property: [Required] Scala class name used as entry point. + * + * @param className the className value to set. + * @return the SparkJobScalaEntry object itself. + */ + public SparkJobScalaEntry withClassName(String className) { + this.className = className; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (className() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property className in model SparkJobScalaEntry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJobScalaEntry.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java new file mode 100644 index 0000000000000..eb617f69665fd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SparkResourceConfiguration model. */ +@Fluent +public final class SparkResourceConfiguration { + /* + * Optional type of VM used as supported by the compute target. + */ + @JsonProperty(value = "instanceType") + private String instanceType; + + /* + * Version of spark runtime used for the job. + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** Creates an instance of SparkResourceConfiguration class. */ + public SparkResourceConfiguration() { + } + + /** + * Get the instanceType property: Optional type of VM used as supported by the compute target. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: Optional type of VM used as supported by the compute target. + * + * @param instanceType the instanceType value to set. + * @return the SparkResourceConfiguration object itself. + */ + public SparkResourceConfiguration withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the runtimeVersion property: Version of spark runtime used for the job. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Version of spark runtime used for the job. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the SparkResourceConfiguration object itself. + */ + public SparkResourceConfiguration withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java new file mode 100644 index 0000000000000..7eaf6b2ca8520 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Static input data definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputDataType") +@JsonTypeName("Static") +@Fluent +public final class StaticInputData extends MonitoringInputDataBase { + /* + * The ARM resource ID of the component resource used to preprocess the data. + */ + @JsonProperty(value = "preprocessingComponentId") + private String preprocessingComponentId; + + /* + * [Required] The end date of the data window. + */ + @JsonProperty(value = "windowEnd", required = true) + private OffsetDateTime windowEnd; + + /* + * [Required] The start date of the data window. + */ + @JsonProperty(value = "windowStart", required = true) + private OffsetDateTime windowStart; + + /** Creates an instance of StaticInputData class. */ + public StaticInputData() { + } + + /** + * Get the preprocessingComponentId property: The ARM resource ID of the component resource used to preprocess the + * data. + * + * @return the preprocessingComponentId value. + */ + public String preprocessingComponentId() { + return this.preprocessingComponentId; + } + + /** + * Set the preprocessingComponentId property: The ARM resource ID of the component resource used to preprocess the + * data. + * + * @param preprocessingComponentId the preprocessingComponentId value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withPreprocessingComponentId(String preprocessingComponentId) { + this.preprocessingComponentId = preprocessingComponentId; + return this; + } + + /** + * Get the windowEnd property: [Required] The end date of the data window. + * + * @return the windowEnd value. + */ + public OffsetDateTime windowEnd() { + return this.windowEnd; + } + + /** + * Set the windowEnd property: [Required] The end date of the data window. + * + * @param windowEnd the windowEnd value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withWindowEnd(OffsetDateTime windowEnd) { + this.windowEnd = windowEnd; + return this; + } + + /** + * Get the windowStart property: [Required] The start date of the data window. + * + * @return the windowStart value. + */ + public OffsetDateTime windowStart() { + return this.windowStart; + } + + /** + * Set the windowStart property: [Required] The start date of the data window. + * + * @param windowStart the windowStart value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withWindowStart(OffsetDateTime windowStart) { + this.windowStart = windowStart; + return this; + } + + /** {@inheritDoc} */ + @Override + public StaticInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** {@inheritDoc} */ + @Override + public StaticInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** {@inheritDoc} */ + @Override + public StaticInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** {@inheritDoc} */ + @Override + public StaticInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (windowEnd() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property windowEnd in model StaticInputData")); + } + if (windowStart() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property windowStart in model StaticInputData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StaticInputData.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessage.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessage.java new file mode 100644 index 0000000000000..39fdda55d12d6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessage.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Active message associated with project. */ +@Immutable +public final class StatusMessage { + /* + * Service-defined message code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Time in UTC at which the message was created. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * Severity level of message. + */ + @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) + private StatusMessageLevel level; + + /* + * A human-readable representation of the message code. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of StatusMessage class. */ + public StatusMessage() { + } + + /** + * Get the code property: Service-defined message code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the createdDateTime property: Time in UTC at which the message was created. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the level property: Severity level of message. + * + * @return the level value. + */ + public StatusMessageLevel level() { + return this.level; + } + + /** + * Get the message property: A human-readable representation of the message code. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessageLevel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessageLevel.java new file mode 100644 index 0000000000000..aff2d2bf3595d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StatusMessageLevel.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StatusMessageLevel. */ +public final class StatusMessageLevel extends ExpandableStringEnum { + /** Static value Error for StatusMessageLevel. */ + public static final StatusMessageLevel ERROR = fromString("Error"); + + /** Static value Information for StatusMessageLevel. */ + public static final StatusMessageLevel INFORMATION = fromString("Information"); + + /** Static value Warning for StatusMessageLevel. */ + public static final StatusMessageLevel WARNING = fromString("Warning"); + + /** + * Creates a new instance of StatusMessageLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusMessageLevel() { + } + + /** + * Creates or finds a StatusMessageLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusMessageLevel. + */ + @JsonCreator + public static StatusMessageLevel fromString(String name) { + return fromString(name, StatusMessageLevel.class); + } + + /** + * Gets known StatusMessageLevel values. + * + * @return known StatusMessageLevel values. + */ + public static Collection values() { + return values(StatusMessageLevel.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java new file mode 100644 index 0000000000000..cbbc66bcece7b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of storage account to be used for the Registry. */ +@Fluent +public final class StorageAccountDetails { + /* + * Details of system created storage account to be used for the registry + */ + @JsonProperty(value = "systemCreatedStorageAccount") + private SystemCreatedStorageAccount systemCreatedStorageAccount; + + /* + * Details of user created storage account to be used for the registry + */ + @JsonProperty(value = "userCreatedStorageAccount") + private UserCreatedStorageAccount userCreatedStorageAccount; + + /** Creates an instance of StorageAccountDetails class. */ + public StorageAccountDetails() { + } + + /** + * Get the systemCreatedStorageAccount property: Details of system created storage account to be used for the + * registry. + * + * @return the systemCreatedStorageAccount value. + */ + public SystemCreatedStorageAccount systemCreatedStorageAccount() { + return this.systemCreatedStorageAccount; + } + + /** + * Set the systemCreatedStorageAccount property: Details of system created storage account to be used for the + * registry. + * + * @param systemCreatedStorageAccount the systemCreatedStorageAccount value to set. + * @return the StorageAccountDetails object itself. + */ + public StorageAccountDetails withSystemCreatedStorageAccount( + SystemCreatedStorageAccount systemCreatedStorageAccount) { + this.systemCreatedStorageAccount = systemCreatedStorageAccount; + return this; + } + + /** + * Get the userCreatedStorageAccount property: Details of user created storage account to be used for the registry. + * + * @return the userCreatedStorageAccount value. + */ + public UserCreatedStorageAccount userCreatedStorageAccount() { + return this.userCreatedStorageAccount; + } + + /** + * Set the userCreatedStorageAccount property: Details of user created storage account to be used for the registry. + * + * @param userCreatedStorageAccount the userCreatedStorageAccount value to set. + * @return the StorageAccountDetails object itself. + */ + public StorageAccountDetails withUserCreatedStorageAccount(UserCreatedStorageAccount userCreatedStorageAccount) { + this.userCreatedStorageAccount = userCreatedStorageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemCreatedStorageAccount() != null) { + systemCreatedStorageAccount().validate(); + } + if (userCreatedStorageAccount() != null) { + userCreatedStorageAccount().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java index 0a72071e3d48f..94810d2e7e073 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java @@ -49,6 +49,12 @@ public final class SweepJob extends JobBaseProperties { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; + /* + * Queue settings for the job + */ + @JsonProperty(value = "queueSettings") + private QueueSettings queueSettings; + /* * [Required] The hyperparameter sampling algorithm */ @@ -174,6 +180,26 @@ public SweepJob withOutputs(Map outputs) { return this; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the SweepJob object itself. + */ + public SweepJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the samplingAlgorithm property: [Required] The hyperparameter sampling algorithm. * @@ -278,6 +304,20 @@ public SweepJob withIsArchived(Boolean isArchived) { return this; } + /** {@inheritDoc} */ + @Override + public SweepJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public SweepJob withSecretsConfiguration(Map secretsConfiguration) { + super.withSecretsConfiguration(secretsConfiguration); + return this; + } + /** {@inheritDoc} */ @Override public SweepJob withServices(Map services) { @@ -347,6 +387,9 @@ public void validate() { } }); } + if (queueSettings() != null) { + queueSettings().validate(); + } if (samplingAlgorithm() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java new file mode 100644 index 0000000000000..45e284f923607 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SystemCreatedAcrAccount model. */ +@Fluent +public final class SystemCreatedAcrAccount { + /* + * Name of the ACR account + */ + @JsonProperty(value = "acrAccountName") + private String acrAccountName; + + /* + * SKU of the ACR account + */ + @JsonProperty(value = "acrAccountSku") + private String acrAccountSku; + + /* + * This is populated once the ACR account is created. + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /** Creates an instance of SystemCreatedAcrAccount class. */ + public SystemCreatedAcrAccount() { + } + + /** + * Get the acrAccountName property: Name of the ACR account. + * + * @return the acrAccountName value. + */ + public String acrAccountName() { + return this.acrAccountName; + } + + /** + * Set the acrAccountName property: Name of the ACR account. + * + * @param acrAccountName the acrAccountName value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withAcrAccountName(String acrAccountName) { + this.acrAccountName = acrAccountName; + return this; + } + + /** + * Get the acrAccountSku property: SKU of the ACR account. + * + * @return the acrAccountSku value. + */ + public String acrAccountSku() { + return this.acrAccountSku; + } + + /** + * Set the acrAccountSku property: SKU of the ACR account. + * + * @param acrAccountSku the acrAccountSku value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withAcrAccountSku(String acrAccountSku) { + this.acrAccountSku = acrAccountSku; + return this; + } + + /** + * Get the armResourceId property: This is populated once the ACR account is created. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: This is populated once the ACR account is created. + * + * @param armResourceId the armResourceId value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java new file mode 100644 index 0000000000000..9cb13029e84f4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SystemCreatedStorageAccount model. */ +@Fluent +public final class SystemCreatedStorageAccount { + /* + * Public blob access allowed + */ + @JsonProperty(value = "allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * This is populated once the storage account is created. + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /* + * HNS enabled for storage account + */ + @JsonProperty(value = "storageAccountHnsEnabled") + private Boolean storageAccountHnsEnabled; + + /* + * Name of the storage account + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /* + * Allowed values: + * "Standard_LRS", + * "Standard_GRS", + * "Standard_RAGRS", + * "Standard_ZRS", + * "Standard_GZRS", + * "Standard_RAGZRS", + * "Premium_LRS", + * "Premium_ZRS" + */ + @JsonProperty(value = "storageAccountType") + private String storageAccountType; + + /** Creates an instance of SystemCreatedStorageAccount class. */ + public SystemCreatedStorageAccount() { + } + + /** + * Get the allowBlobPublicAccess property: Public blob access allowed. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Public blob access allowed. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the armResourceId property: This is populated once the storage account is created. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: This is populated once the storage account is created. + * + * @param armResourceId the armResourceId value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Get the storageAccountHnsEnabled property: HNS enabled for storage account. + * + * @return the storageAccountHnsEnabled value. + */ + public Boolean storageAccountHnsEnabled() { + return this.storageAccountHnsEnabled; + } + + /** + * Set the storageAccountHnsEnabled property: HNS enabled for storage account. + * + * @param storageAccountHnsEnabled the storageAccountHnsEnabled value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountHnsEnabled(Boolean storageAccountHnsEnabled) { + this.storageAccountHnsEnabled = storageAccountHnsEnabled; + return this; + } + + /** + * Get the storageAccountName property: Name of the storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Name of the storage account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountType property: Allowed values: "Standard_LRS", "Standard_GRS", "Standard_RAGRS", + * "Standard_ZRS", "Standard_GZRS", "Standard_RAGZRS", "Premium_LRS", "Premium_ZRS". + * + * @return the storageAccountType value. + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Allowed values: "Standard_LRS", "Standard_GRS", "Standard_RAGRS", + * "Standard_ZRS", "Standard_GZRS", "Standard_RAGZRS", "Premium_LRS", "Premium_ZRS". + * + * @param storageAccountType the storageAccountType value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountType(String storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableFixedParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableFixedParameters.java new file mode 100644 index 0000000000000..4a6f593253c29 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableFixedParameters.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Fixed training parameters that won't be swept over during AutoML Table training. */ +@Fluent +public final class TableFixedParameters { + /* + * Specify the boosting type, e.g gbdt for XGBoost. + */ + @JsonProperty(value = "booster") + private String booster; + + /* + * Specify the boosting type, e.g gbdt for LightGBM. + */ + @JsonProperty(value = "boostingType") + private String boostingType; + + /* + * Specify the grow policy, which controls the way new nodes are added to the tree. + */ + @JsonProperty(value = "growPolicy") + private String growPolicy; + + /* + * The learning rate for the training procedure. + */ + @JsonProperty(value = "learningRate") + private Double learningRate; + + /* + * Specify the Maximum number of discrete bins to bucket continuous features . + */ + @JsonProperty(value = "maxBin") + private Integer maxBin; + + /* + * Specify the max depth to limit the tree depth explicitly. + */ + @JsonProperty(value = "maxDepth") + private Integer maxDepth; + + /* + * Specify the max leaves to limit the tree leaves explicitly. + */ + @JsonProperty(value = "maxLeaves") + private Integer maxLeaves; + + /* + * The minimum number of data per leaf. + */ + @JsonProperty(value = "minDataInLeaf") + private Integer minDataInLeaf; + + /* + * Minimum loss reduction required to make a further partition on a leaf node of the tree. + */ + @JsonProperty(value = "minSplitGain") + private Double minSplitGain; + + /* + * The name of the model to train. + */ + @JsonProperty(value = "modelName") + private String modelName; + + /* + * Specify the number of trees (or rounds) in an model. + */ + @JsonProperty(value = "nEstimators") + private Integer nEstimators; + + /* + * Specify the number of leaves. + */ + @JsonProperty(value = "numLeaves") + private Integer numLeaves; + + /* + * The name of the preprocessor to use. + */ + @JsonProperty(value = "preprocessorName") + private String preprocessorName; + + /* + * L1 regularization term on weights. + */ + @JsonProperty(value = "regAlpha") + private Double regAlpha; + + /* + * L2 regularization term on weights. + */ + @JsonProperty(value = "regLambda") + private Double regLambda; + + /* + * Subsample ratio of the training instance. + */ + @JsonProperty(value = "subsample") + private Double subsample; + + /* + * Frequency of subsample. + */ + @JsonProperty(value = "subsampleFreq") + private Double subsampleFreq; + + /* + * Specify the tree method. + */ + @JsonProperty(value = "treeMethod") + private String treeMethod; + + /* + * If true, center before scaling the data with StandardScalar. + */ + @JsonProperty(value = "withMean") + private Boolean withMean; + + /* + * If true, scaling the data with Unit Variance with StandardScalar. + */ + @JsonProperty(value = "withStd") + private Boolean withStd; + + /** Creates an instance of TableFixedParameters class. */ + public TableFixedParameters() { + } + + /** + * Get the booster property: Specify the boosting type, e.g gbdt for XGBoost. + * + * @return the booster value. + */ + public String booster() { + return this.booster; + } + + /** + * Set the booster property: Specify the boosting type, e.g gbdt for XGBoost. + * + * @param booster the booster value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withBooster(String booster) { + this.booster = booster; + return this; + } + + /** + * Get the boostingType property: Specify the boosting type, e.g gbdt for LightGBM. + * + * @return the boostingType value. + */ + public String boostingType() { + return this.boostingType; + } + + /** + * Set the boostingType property: Specify the boosting type, e.g gbdt for LightGBM. + * + * @param boostingType the boostingType value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withBoostingType(String boostingType) { + this.boostingType = boostingType; + return this; + } + + /** + * Get the growPolicy property: Specify the grow policy, which controls the way new nodes are added to the tree. + * + * @return the growPolicy value. + */ + public String growPolicy() { + return this.growPolicy; + } + + /** + * Set the growPolicy property: Specify the grow policy, which controls the way new nodes are added to the tree. + * + * @param growPolicy the growPolicy value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withGrowPolicy(String growPolicy) { + this.growPolicy = growPolicy; + return this; + } + + /** + * Get the learningRate property: The learning rate for the training procedure. + * + * @return the learningRate value. + */ + public Double learningRate() { + return this.learningRate; + } + + /** + * Set the learningRate property: The learning rate for the training procedure. + * + * @param learningRate the learningRate value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withLearningRate(Double learningRate) { + this.learningRate = learningRate; + return this; + } + + /** + * Get the maxBin property: Specify the Maximum number of discrete bins to bucket continuous features . + * + * @return the maxBin value. + */ + public Integer maxBin() { + return this.maxBin; + } + + /** + * Set the maxBin property: Specify the Maximum number of discrete bins to bucket continuous features . + * + * @param maxBin the maxBin value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withMaxBin(Integer maxBin) { + this.maxBin = maxBin; + return this; + } + + /** + * Get the maxDepth property: Specify the max depth to limit the tree depth explicitly. + * + * @return the maxDepth value. + */ + public Integer maxDepth() { + return this.maxDepth; + } + + /** + * Set the maxDepth property: Specify the max depth to limit the tree depth explicitly. + * + * @param maxDepth the maxDepth value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withMaxDepth(Integer maxDepth) { + this.maxDepth = maxDepth; + return this; + } + + /** + * Get the maxLeaves property: Specify the max leaves to limit the tree leaves explicitly. + * + * @return the maxLeaves value. + */ + public Integer maxLeaves() { + return this.maxLeaves; + } + + /** + * Set the maxLeaves property: Specify the max leaves to limit the tree leaves explicitly. + * + * @param maxLeaves the maxLeaves value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withMaxLeaves(Integer maxLeaves) { + this.maxLeaves = maxLeaves; + return this; + } + + /** + * Get the minDataInLeaf property: The minimum number of data per leaf. + * + * @return the minDataInLeaf value. + */ + public Integer minDataInLeaf() { + return this.minDataInLeaf; + } + + /** + * Set the minDataInLeaf property: The minimum number of data per leaf. + * + * @param minDataInLeaf the minDataInLeaf value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withMinDataInLeaf(Integer minDataInLeaf) { + this.minDataInLeaf = minDataInLeaf; + return this; + } + + /** + * Get the minSplitGain property: Minimum loss reduction required to make a further partition on a leaf node of the + * tree. + * + * @return the minSplitGain value. + */ + public Double minSplitGain() { + return this.minSplitGain; + } + + /** + * Set the minSplitGain property: Minimum loss reduction required to make a further partition on a leaf node of the + * tree. + * + * @param minSplitGain the minSplitGain value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withMinSplitGain(Double minSplitGain) { + this.minSplitGain = minSplitGain; + return this; + } + + /** + * Get the modelName property: The name of the model to train. + * + * @return the modelName value. + */ + public String modelName() { + return this.modelName; + } + + /** + * Set the modelName property: The name of the model to train. + * + * @param modelName the modelName value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withModelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get the nEstimators property: Specify the number of trees (or rounds) in an model. + * + * @return the nEstimators value. + */ + public Integer nEstimators() { + return this.nEstimators; + } + + /** + * Set the nEstimators property: Specify the number of trees (or rounds) in an model. + * + * @param nEstimators the nEstimators value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withNEstimators(Integer nEstimators) { + this.nEstimators = nEstimators; + return this; + } + + /** + * Get the numLeaves property: Specify the number of leaves. + * + * @return the numLeaves value. + */ + public Integer numLeaves() { + return this.numLeaves; + } + + /** + * Set the numLeaves property: Specify the number of leaves. + * + * @param numLeaves the numLeaves value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withNumLeaves(Integer numLeaves) { + this.numLeaves = numLeaves; + return this; + } + + /** + * Get the preprocessorName property: The name of the preprocessor to use. + * + * @return the preprocessorName value. + */ + public String preprocessorName() { + return this.preprocessorName; + } + + /** + * Set the preprocessorName property: The name of the preprocessor to use. + * + * @param preprocessorName the preprocessorName value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withPreprocessorName(String preprocessorName) { + this.preprocessorName = preprocessorName; + return this; + } + + /** + * Get the regAlpha property: L1 regularization term on weights. + * + * @return the regAlpha value. + */ + public Double regAlpha() { + return this.regAlpha; + } + + /** + * Set the regAlpha property: L1 regularization term on weights. + * + * @param regAlpha the regAlpha value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withRegAlpha(Double regAlpha) { + this.regAlpha = regAlpha; + return this; + } + + /** + * Get the regLambda property: L2 regularization term on weights. + * + * @return the regLambda value. + */ + public Double regLambda() { + return this.regLambda; + } + + /** + * Set the regLambda property: L2 regularization term on weights. + * + * @param regLambda the regLambda value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withRegLambda(Double regLambda) { + this.regLambda = regLambda; + return this; + } + + /** + * Get the subsample property: Subsample ratio of the training instance. + * + * @return the subsample value. + */ + public Double subsample() { + return this.subsample; + } + + /** + * Set the subsample property: Subsample ratio of the training instance. + * + * @param subsample the subsample value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withSubsample(Double subsample) { + this.subsample = subsample; + return this; + } + + /** + * Get the subsampleFreq property: Frequency of subsample. + * + * @return the subsampleFreq value. + */ + public Double subsampleFreq() { + return this.subsampleFreq; + } + + /** + * Set the subsampleFreq property: Frequency of subsample. + * + * @param subsampleFreq the subsampleFreq value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withSubsampleFreq(Double subsampleFreq) { + this.subsampleFreq = subsampleFreq; + return this; + } + + /** + * Get the treeMethod property: Specify the tree method. + * + * @return the treeMethod value. + */ + public String treeMethod() { + return this.treeMethod; + } + + /** + * Set the treeMethod property: Specify the tree method. + * + * @param treeMethod the treeMethod value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withTreeMethod(String treeMethod) { + this.treeMethod = treeMethod; + return this; + } + + /** + * Get the withMean property: If true, center before scaling the data with StandardScalar. + * + * @return the withMean value. + */ + public Boolean withMean() { + return this.withMean; + } + + /** + * Set the withMean property: If true, center before scaling the data with StandardScalar. + * + * @param withMean the withMean value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withWithMean(Boolean withMean) { + this.withMean = withMean; + return this; + } + + /** + * Get the withStd property: If true, scaling the data with Unit Variance with StandardScalar. + * + * @return the withStd value. + */ + public Boolean withStd() { + return this.withStd; + } + + /** + * Set the withStd property: If true, scaling the data with Unit Variance with StandardScalar. + * + * @param withStd the withStd value to set. + * @return the TableFixedParameters object itself. + */ + public TableFixedParameters withWithStd(Boolean withStd) { + this.withStd = withStd; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableParameterSubspace.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableParameterSubspace.java new file mode 100644 index 0000000000000..d2840a20c83d6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableParameterSubspace.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TableParameterSubspace model. */ +@Fluent +public final class TableParameterSubspace { + /* + * Specify the boosting type, e.g gbdt for XGBoost. + */ + @JsonProperty(value = "booster") + private String booster; + + /* + * Specify the boosting type, e.g gbdt for LightGBM. + */ + @JsonProperty(value = "boostingType") + private String boostingType; + + /* + * Specify the grow policy, which controls the way new nodes are added to the tree. + */ + @JsonProperty(value = "growPolicy") + private String growPolicy; + + /* + * The learning rate for the training procedure. + */ + @JsonProperty(value = "learningRate") + private String learningRate; + + /* + * Specify the Maximum number of discrete bins to bucket continuous features . + */ + @JsonProperty(value = "maxBin") + private String maxBin; + + /* + * Specify the max depth to limit the tree depth explicitly. + */ + @JsonProperty(value = "maxDepth") + private String maxDepth; + + /* + * Specify the max leaves to limit the tree leaves explicitly. + */ + @JsonProperty(value = "maxLeaves") + private String maxLeaves; + + /* + * The minimum number of data per leaf. + */ + @JsonProperty(value = "minDataInLeaf") + private String minDataInLeaf; + + /* + * Minimum loss reduction required to make a further partition on a leaf node of the tree. + */ + @JsonProperty(value = "minSplitGain") + private String minSplitGain; + + /* + * The name of the model to train. + */ + @JsonProperty(value = "modelName") + private String modelName; + + /* + * Specify the number of trees (or rounds) in an model. + */ + @JsonProperty(value = "nEstimators") + private String nEstimators; + + /* + * Specify the number of leaves. + */ + @JsonProperty(value = "numLeaves") + private String numLeaves; + + /* + * The name of the preprocessor to use. + */ + @JsonProperty(value = "preprocessorName") + private String preprocessorName; + + /* + * L1 regularization term on weights. + */ + @JsonProperty(value = "regAlpha") + private String regAlpha; + + /* + * L2 regularization term on weights. + */ + @JsonProperty(value = "regLambda") + private String regLambda; + + /* + * Subsample ratio of the training instance. + */ + @JsonProperty(value = "subsample") + private String subsample; + + /* + * Frequency of subsample + */ + @JsonProperty(value = "subsampleFreq") + private String subsampleFreq; + + /* + * Specify the tree method. + */ + @JsonProperty(value = "treeMethod") + private String treeMethod; + + /* + * If true, center before scaling the data with StandardScalar. + */ + @JsonProperty(value = "withMean") + private String withMean; + + /* + * If true, scaling the data with Unit Variance with StandardScalar. + */ + @JsonProperty(value = "withStd") + private String withStd; + + /** Creates an instance of TableParameterSubspace class. */ + public TableParameterSubspace() { + } + + /** + * Get the booster property: Specify the boosting type, e.g gbdt for XGBoost. + * + * @return the booster value. + */ + public String booster() { + return this.booster; + } + + /** + * Set the booster property: Specify the boosting type, e.g gbdt for XGBoost. + * + * @param booster the booster value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withBooster(String booster) { + this.booster = booster; + return this; + } + + /** + * Get the boostingType property: Specify the boosting type, e.g gbdt for LightGBM. + * + * @return the boostingType value. + */ + public String boostingType() { + return this.boostingType; + } + + /** + * Set the boostingType property: Specify the boosting type, e.g gbdt for LightGBM. + * + * @param boostingType the boostingType value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withBoostingType(String boostingType) { + this.boostingType = boostingType; + return this; + } + + /** + * Get the growPolicy property: Specify the grow policy, which controls the way new nodes are added to the tree. + * + * @return the growPolicy value. + */ + public String growPolicy() { + return this.growPolicy; + } + + /** + * Set the growPolicy property: Specify the grow policy, which controls the way new nodes are added to the tree. + * + * @param growPolicy the growPolicy value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withGrowPolicy(String growPolicy) { + this.growPolicy = growPolicy; + return this; + } + + /** + * Get the learningRate property: The learning rate for the training procedure. + * + * @return the learningRate value. + */ + public String learningRate() { + return this.learningRate; + } + + /** + * Set the learningRate property: The learning rate for the training procedure. + * + * @param learningRate the learningRate value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withLearningRate(String learningRate) { + this.learningRate = learningRate; + return this; + } + + /** + * Get the maxBin property: Specify the Maximum number of discrete bins to bucket continuous features . + * + * @return the maxBin value. + */ + public String maxBin() { + return this.maxBin; + } + + /** + * Set the maxBin property: Specify the Maximum number of discrete bins to bucket continuous features . + * + * @param maxBin the maxBin value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withMaxBin(String maxBin) { + this.maxBin = maxBin; + return this; + } + + /** + * Get the maxDepth property: Specify the max depth to limit the tree depth explicitly. + * + * @return the maxDepth value. + */ + public String maxDepth() { + return this.maxDepth; + } + + /** + * Set the maxDepth property: Specify the max depth to limit the tree depth explicitly. + * + * @param maxDepth the maxDepth value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withMaxDepth(String maxDepth) { + this.maxDepth = maxDepth; + return this; + } + + /** + * Get the maxLeaves property: Specify the max leaves to limit the tree leaves explicitly. + * + * @return the maxLeaves value. + */ + public String maxLeaves() { + return this.maxLeaves; + } + + /** + * Set the maxLeaves property: Specify the max leaves to limit the tree leaves explicitly. + * + * @param maxLeaves the maxLeaves value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withMaxLeaves(String maxLeaves) { + this.maxLeaves = maxLeaves; + return this; + } + + /** + * Get the minDataInLeaf property: The minimum number of data per leaf. + * + * @return the minDataInLeaf value. + */ + public String minDataInLeaf() { + return this.minDataInLeaf; + } + + /** + * Set the minDataInLeaf property: The minimum number of data per leaf. + * + * @param minDataInLeaf the minDataInLeaf value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withMinDataInLeaf(String minDataInLeaf) { + this.minDataInLeaf = minDataInLeaf; + return this; + } + + /** + * Get the minSplitGain property: Minimum loss reduction required to make a further partition on a leaf node of the + * tree. + * + * @return the minSplitGain value. + */ + public String minSplitGain() { + return this.minSplitGain; + } + + /** + * Set the minSplitGain property: Minimum loss reduction required to make a further partition on a leaf node of the + * tree. + * + * @param minSplitGain the minSplitGain value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withMinSplitGain(String minSplitGain) { + this.minSplitGain = minSplitGain; + return this; + } + + /** + * Get the modelName property: The name of the model to train. + * + * @return the modelName value. + */ + public String modelName() { + return this.modelName; + } + + /** + * Set the modelName property: The name of the model to train. + * + * @param modelName the modelName value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withModelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get the nEstimators property: Specify the number of trees (or rounds) in an model. + * + * @return the nEstimators value. + */ + public String nEstimators() { + return this.nEstimators; + } + + /** + * Set the nEstimators property: Specify the number of trees (or rounds) in an model. + * + * @param nEstimators the nEstimators value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withNEstimators(String nEstimators) { + this.nEstimators = nEstimators; + return this; + } + + /** + * Get the numLeaves property: Specify the number of leaves. + * + * @return the numLeaves value. + */ + public String numLeaves() { + return this.numLeaves; + } + + /** + * Set the numLeaves property: Specify the number of leaves. + * + * @param numLeaves the numLeaves value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withNumLeaves(String numLeaves) { + this.numLeaves = numLeaves; + return this; + } + + /** + * Get the preprocessorName property: The name of the preprocessor to use. + * + * @return the preprocessorName value. + */ + public String preprocessorName() { + return this.preprocessorName; + } + + /** + * Set the preprocessorName property: The name of the preprocessor to use. + * + * @param preprocessorName the preprocessorName value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withPreprocessorName(String preprocessorName) { + this.preprocessorName = preprocessorName; + return this; + } + + /** + * Get the regAlpha property: L1 regularization term on weights. + * + * @return the regAlpha value. + */ + public String regAlpha() { + return this.regAlpha; + } + + /** + * Set the regAlpha property: L1 regularization term on weights. + * + * @param regAlpha the regAlpha value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withRegAlpha(String regAlpha) { + this.regAlpha = regAlpha; + return this; + } + + /** + * Get the regLambda property: L2 regularization term on weights. + * + * @return the regLambda value. + */ + public String regLambda() { + return this.regLambda; + } + + /** + * Set the regLambda property: L2 regularization term on weights. + * + * @param regLambda the regLambda value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withRegLambda(String regLambda) { + this.regLambda = regLambda; + return this; + } + + /** + * Get the subsample property: Subsample ratio of the training instance. + * + * @return the subsample value. + */ + public String subsample() { + return this.subsample; + } + + /** + * Set the subsample property: Subsample ratio of the training instance. + * + * @param subsample the subsample value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withSubsample(String subsample) { + this.subsample = subsample; + return this; + } + + /** + * Get the subsampleFreq property: Frequency of subsample. + * + * @return the subsampleFreq value. + */ + public String subsampleFreq() { + return this.subsampleFreq; + } + + /** + * Set the subsampleFreq property: Frequency of subsample. + * + * @param subsampleFreq the subsampleFreq value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withSubsampleFreq(String subsampleFreq) { + this.subsampleFreq = subsampleFreq; + return this; + } + + /** + * Get the treeMethod property: Specify the tree method. + * + * @return the treeMethod value. + */ + public String treeMethod() { + return this.treeMethod; + } + + /** + * Set the treeMethod property: Specify the tree method. + * + * @param treeMethod the treeMethod value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withTreeMethod(String treeMethod) { + this.treeMethod = treeMethod; + return this; + } + + /** + * Get the withMean property: If true, center before scaling the data with StandardScalar. + * + * @return the withMean value. + */ + public String withMean() { + return this.withMean; + } + + /** + * Set the withMean property: If true, center before scaling the data with StandardScalar. + * + * @param withMean the withMean value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withWithMean(String withMean) { + this.withMean = withMean; + return this; + } + + /** + * Get the withStd property: If true, scaling the data with Unit Variance with StandardScalar. + * + * @return the withStd value. + */ + public String withStd() { + return this.withStd; + } + + /** + * Set the withStd property: If true, scaling the data with Unit Variance with StandardScalar. + * + * @param withStd the withStd value to set. + * @return the TableParameterSubspace object itself. + */ + public TableParameterSubspace withWithStd(String withStd) { + this.withStd = withStd; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableSweepSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableSweepSettings.java new file mode 100644 index 0000000000000..54410f5fd4919 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableSweepSettings.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TableSweepSettings model. */ +@Fluent +public final class TableSweepSettings { + /* + * Type of early termination policy for the sweeping job. + */ + @JsonProperty(value = "earlyTermination") + private EarlyTerminationPolicy earlyTermination; + + /* + * [Required] Type of sampling algorithm. + */ + @JsonProperty(value = "samplingAlgorithm", required = true) + private SamplingAlgorithmType samplingAlgorithm; + + /** Creates an instance of TableSweepSettings class. */ + public TableSweepSettings() { + } + + /** + * Get the earlyTermination property: Type of early termination policy for the sweeping job. + * + * @return the earlyTermination value. + */ + public EarlyTerminationPolicy earlyTermination() { + return this.earlyTermination; + } + + /** + * Set the earlyTermination property: Type of early termination policy for the sweeping job. + * + * @param earlyTermination the earlyTermination value to set. + * @return the TableSweepSettings object itself. + */ + public TableSweepSettings withEarlyTermination(EarlyTerminationPolicy earlyTermination) { + this.earlyTermination = earlyTermination; + return this; + } + + /** + * Get the samplingAlgorithm property: [Required] Type of sampling algorithm. + * + * @return the samplingAlgorithm value. + */ + public SamplingAlgorithmType samplingAlgorithm() { + return this.samplingAlgorithm; + } + + /** + * Set the samplingAlgorithm property: [Required] Type of sampling algorithm. + * + * @param samplingAlgorithm the samplingAlgorithm value to set. + * @return the TableSweepSettings object itself. + */ + public TableSweepSettings withSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithm) { + this.samplingAlgorithm = samplingAlgorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (earlyTermination() != null) { + earlyTermination().validate(); + } + if (samplingAlgorithm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property samplingAlgorithm in model TableSweepSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableSweepSettings.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java index c9bb43ee04433..f5becc1da990f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java @@ -23,6 +23,12 @@ public class TableVertical { @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private TableFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @@ -36,6 +42,18 @@ public class TableVertical { @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private TableSweepSettings sweepSettings; + /* * Test data input. */ @@ -115,6 +133,26 @@ public TableVertical withFeaturizationSettings(TableVerticalFeaturizationSetting return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public TableFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the TableVertical object itself. + */ + public TableVertical withFixedParameters(TableFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -157,6 +195,48 @@ public TableVertical withNCrossValidations(NCrossValidations nCrossValidations) return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the TableVertical object itself. + */ + public TableVertical withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public TableSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the TableVertical object itself. + */ + public TableVertical withSweepSettings(TableSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the testData property: Test data input. * @@ -272,12 +352,21 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } if (nCrossValidations() != null) { nCrossValidations().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (testData() != null) { testData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java index 92ee3e6cee9bb..e8804ee9f70a8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java @@ -36,12 +36,30 @@ public final class TableVerticalLimitSettings { @JsonProperty(value = "maxCoresPerTrial") private Integer maxCoresPerTrial; + /* + * Maximum nodes to use for the experiment. + */ + @JsonProperty(value = "maxNodes") + private Integer maxNodes; + /* * Number of iterations. */ @JsonProperty(value = "maxTrials") private Integer maxTrials; + /* + * Number of concurrent sweeping runs that user wants to trigger. + */ + @JsonProperty(value = "sweepConcurrentTrials") + private Integer sweepConcurrentTrials; + + /* + * Number of sweeping runs that user wants to trigger. + */ + @JsonProperty(value = "sweepTrials") + private Integer sweepTrials; + /* * AutoML job timeout. */ @@ -140,6 +158,26 @@ public TableVerticalLimitSettings withMaxCoresPerTrial(Integer maxCoresPerTrial) return this; } + /** + * Get the maxNodes property: Maximum nodes to use for the experiment. + * + * @return the maxNodes value. + */ + public Integer maxNodes() { + return this.maxNodes; + } + + /** + * Set the maxNodes property: Maximum nodes to use for the experiment. + * + * @param maxNodes the maxNodes value to set. + * @return the TableVerticalLimitSettings object itself. + */ + public TableVerticalLimitSettings withMaxNodes(Integer maxNodes) { + this.maxNodes = maxNodes; + return this; + } + /** * Get the maxTrials property: Number of iterations. * @@ -160,6 +198,46 @@ public TableVerticalLimitSettings withMaxTrials(Integer maxTrials) { return this; } + /** + * Get the sweepConcurrentTrials property: Number of concurrent sweeping runs that user wants to trigger. + * + * @return the sweepConcurrentTrials value. + */ + public Integer sweepConcurrentTrials() { + return this.sweepConcurrentTrials; + } + + /** + * Set the sweepConcurrentTrials property: Number of concurrent sweeping runs that user wants to trigger. + * + * @param sweepConcurrentTrials the sweepConcurrentTrials value to set. + * @return the TableVerticalLimitSettings object itself. + */ + public TableVerticalLimitSettings withSweepConcurrentTrials(Integer sweepConcurrentTrials) { + this.sweepConcurrentTrials = sweepConcurrentTrials; + return this; + } + + /** + * Get the sweepTrials property: Number of sweeping runs that user wants to trigger. + * + * @return the sweepTrials value. + */ + public Integer sweepTrials() { + return this.sweepTrials; + } + + /** + * Set the sweepTrials property: Number of sweeping runs that user wants to trigger. + * + * @param sweepTrials the sweepTrials value to set. + * @return the TableVerticalLimitSettings object itself. + */ + public TableVerticalLimitSettings withSweepTrials(Integer sweepTrials) { + this.sweepTrials = sweepTrials; + return this; + } + /** * Get the timeout property: AutoML job timeout. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextAnnotationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextAnnotationType.java new file mode 100644 index 0000000000000..abd55eae8adef --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextAnnotationType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Annotation type of text data. */ +public final class TextAnnotationType extends ExpandableStringEnum { + /** Static value Classification for TextAnnotationType. */ + public static final TextAnnotationType CLASSIFICATION = fromString("Classification"); + + /** Static value NamedEntityRecognition for TextAnnotationType. */ + public static final TextAnnotationType NAMED_ENTITY_RECOGNITION = fromString("NamedEntityRecognition"); + + /** + * Creates a new instance of TextAnnotationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TextAnnotationType() { + } + + /** + * Creates or finds a TextAnnotationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TextAnnotationType. + */ + @JsonCreator + public static TextAnnotationType fromString(String name) { + return fromString(name, TextAnnotationType.class); + } + + /** + * Gets known TextAnnotationType values. + * + * @return known TextAnnotationType values. + */ + public static Collection values() { + return values(TextAnnotationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java index 72f0a652601ee..ba8bb3dfee3a9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Text Classification task in AutoML NLP vertical. NLP - Natural Language Processing. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @@ -26,12 +27,30 @@ public final class TextClassification extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private NlpFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private NlpSweepSettings sweepSettings; + /* * Validation data inputs. */ @@ -82,6 +101,26 @@ public TextClassification withFeaturizationSettings(NlpVerticalFeaturizationSett return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public NlpFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the TextClassification object itself. + */ + public TextClassification withFixedParameters(NlpFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -102,6 +141,48 @@ public TextClassification withLimitSettings(NlpVerticalLimitSettings limitSettin return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the TextClassification object itself. + */ + public TextClassification withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public NlpSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the TextClassification object itself. + */ + public TextClassification withSweepSettings(NlpSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the validationData property: Validation data inputs. * @@ -154,9 +235,18 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (validationData() != null) { validationData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java index ceb85f9675e78..55baedcc8075e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Text Classification Multilabel task in AutoML NLP vertical. NLP - Natural Language Processing. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @@ -27,12 +28,30 @@ public final class TextClassificationMultilabel extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private NlpFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private NlpSweepSettings sweepSettings; + /* * Validation data inputs. */ @@ -74,6 +93,26 @@ public TextClassificationMultilabel withFeaturizationSettings( return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public NlpFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the TextClassificationMultilabel object itself. + */ + public TextClassificationMultilabel withFixedParameters(NlpFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -94,6 +133,48 @@ public TextClassificationMultilabel withLimitSettings(NlpVerticalLimitSettings l return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the TextClassificationMultilabel object itself. + */ + public TextClassificationMultilabel withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public NlpSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the TextClassificationMultilabel object itself. + */ + public TextClassificationMultilabel withSweepSettings(NlpSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the validationData property: Validation data inputs. * @@ -146,9 +227,18 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (validationData() != null) { validationData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java index ed17e1f9beb25..503be3ced15fa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Text-NER task in AutoML NLP vertical. NER - Named Entity Recognition. NLP - Natural Language Processing. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @@ -27,12 +28,30 @@ public final class TextNer extends AutoMLVertical { @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; + /* + * Model/training parameters that will remain constant throughout training. + */ + @JsonProperty(value = "fixedParameters") + private NlpFixedParameters fixedParameters; + /* * Execution constraints for AutoMLJob. */ @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; + /* + * Search space for sampling different combinations of models and their hyperparameters. + */ + @JsonProperty(value = "searchSpace") + private List searchSpace; + + /* + * Settings for model sweeping and hyperparameter tuning. + */ + @JsonProperty(value = "sweepSettings") + private NlpSweepSettings sweepSettings; + /* * Validation data inputs. */ @@ -73,6 +92,26 @@ public TextNer withFeaturizationSettings(NlpVerticalFeaturizationSettings featur return this; } + /** + * Get the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @return the fixedParameters value. + */ + public NlpFixedParameters fixedParameters() { + return this.fixedParameters; + } + + /** + * Set the fixedParameters property: Model/training parameters that will remain constant throughout training. + * + * @param fixedParameters the fixedParameters value to set. + * @return the TextNer object itself. + */ + public TextNer withFixedParameters(NlpFixedParameters fixedParameters) { + this.fixedParameters = fixedParameters; + return this; + } + /** * Get the limitSettings property: Execution constraints for AutoMLJob. * @@ -93,6 +132,48 @@ public TextNer withLimitSettings(NlpVerticalLimitSettings limitSettings) { return this; } + /** + * Get the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @return the searchSpace value. + */ + public List searchSpace() { + return this.searchSpace; + } + + /** + * Set the searchSpace property: Search space for sampling different combinations of models and their + * hyperparameters. + * + * @param searchSpace the searchSpace value to set. + * @return the TextNer object itself. + */ + public TextNer withSearchSpace(List searchSpace) { + this.searchSpace = searchSpace; + return this; + } + + /** + * Get the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @return the sweepSettings value. + */ + public NlpSweepSettings sweepSettings() { + return this.sweepSettings; + } + + /** + * Set the sweepSettings property: Settings for model sweeping and hyperparameter tuning. + * + * @param sweepSettings the sweepSettings value to set. + * @return the TextNer object itself. + */ + public TextNer withSweepSettings(NlpSweepSettings sweepSettings) { + this.sweepSettings = sweepSettings; + return this; + } + /** * Get the validationData property: Validation data inputs. * @@ -145,9 +226,18 @@ public void validate() { if (featurizationSettings() != null) { featurizationSettings().validate(); } + if (fixedParameters() != null) { + fixedParameters().validate(); + } if (limitSettings() != null) { limitSettings().validate(); } + if (searchSpace() != null) { + searchSpace().forEach(e -> e.validate()); + } + if (sweepSettings() != null) { + sweepSettings().validate(); + } if (validationData() != null) { validationData().validate(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java new file mode 100644 index 0000000000000..77538483da3d7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TmpfsOptions model. */ +@Fluent +public final class TmpfsOptions { + /* + * Mention the Tmpfs size + */ + @JsonProperty(value = "size") + private Integer size; + + /** Creates an instance of TmpfsOptions class. */ + public TmpfsOptions() { + } + + /** + * Get the size property: Mention the Tmpfs size. + * + * @return the size value. + */ + public Integer size() { + return this.size; + } + + /** + * Set the size property: Mention the Tmpfs size. + * + * @param size the size value to set. + * @return the TmpfsOptions object itself. + */ + public TmpfsOptions withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java new file mode 100644 index 0000000000000..7a0770a16c5b2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The TopNFeaturesByAttribution model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "filterType") +@JsonTypeName("TopNByAttribution") +@Fluent +public final class TopNFeaturesByAttribution extends MonitoringFeatureFilterBase { + /* + * The number of top features to include. + */ + @JsonProperty(value = "top") + private Integer top; + + /** Creates an instance of TopNFeaturesByAttribution class. */ + public TopNFeaturesByAttribution() { + } + + /** + * Get the top property: The number of top features to include. + * + * @return the top value. + */ + public Integer top() { + return this.top; + } + + /** + * Set the top property: The number of top features to include. + * + * @param top the top value to set. + * @return the TopNFeaturesByAttribution object itself. + */ + public TopNFeaturesByAttribution withTop(Integer top) { + this.top = top; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrailingInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrailingInputData.java new file mode 100644 index 0000000000000..4e7453b3f986f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrailingInputData.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.util.Map; + +/** Trailing input data definition. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputDataType") +@JsonTypeName("Trailing") +@Fluent +public final class TrailingInputData extends MonitoringInputDataBase { + /* + * The ARM resource ID of the component resource used to preprocess the data. + */ + @JsonProperty(value = "preprocessingComponentId") + private String preprocessingComponentId; + + /* + * [Required] The time offset between the end of the data window and the monitor's current run time. + */ + @JsonProperty(value = "windowOffset", required = true) + private Duration windowOffset; + + /* + * [Required] The size of the trailing data window. + */ + @JsonProperty(value = "windowSize", required = true) + private Duration windowSize; + + /** Creates an instance of TrailingInputData class. */ + public TrailingInputData() { + } + + /** + * Get the preprocessingComponentId property: The ARM resource ID of the component resource used to preprocess the + * data. + * + * @return the preprocessingComponentId value. + */ + public String preprocessingComponentId() { + return this.preprocessingComponentId; + } + + /** + * Set the preprocessingComponentId property: The ARM resource ID of the component resource used to preprocess the + * data. + * + * @param preprocessingComponentId the preprocessingComponentId value to set. + * @return the TrailingInputData object itself. + */ + public TrailingInputData withPreprocessingComponentId(String preprocessingComponentId) { + this.preprocessingComponentId = preprocessingComponentId; + return this; + } + + /** + * Get the windowOffset property: [Required] The time offset between the end of the data window and the monitor's + * current run time. + * + * @return the windowOffset value. + */ + public Duration windowOffset() { + return this.windowOffset; + } + + /** + * Set the windowOffset property: [Required] The time offset between the end of the data window and the monitor's + * current run time. + * + * @param windowOffset the windowOffset value to set. + * @return the TrailingInputData object itself. + */ + public TrailingInputData withWindowOffset(Duration windowOffset) { + this.windowOffset = windowOffset; + return this; + } + + /** + * Get the windowSize property: [Required] The size of the trailing data window. + * + * @return the windowSize value. + */ + public Duration windowSize() { + return this.windowSize; + } + + /** + * Set the windowSize property: [Required] The size of the trailing data window. + * + * @param windowSize the windowSize value to set. + * @return the TrailingInputData object itself. + */ + public TrailingInputData withWindowSize(Duration windowSize) { + this.windowSize = windowSize; + return this; + } + + /** {@inheritDoc} */ + @Override + public TrailingInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** {@inheritDoc} */ + @Override + public TrailingInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** {@inheritDoc} */ + @Override + public TrailingInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** {@inheritDoc} */ + @Override + public TrailingInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (windowOffset() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property windowOffset in model TrailingInputData")); + } + if (windowSize() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property windowSize in model TrailingInputData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TrailingInputData.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingMode.java new file mode 100644 index 0000000000000..46bbd97711f0d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Training mode dictates whether to use distributed training or not. */ +public final class TrainingMode extends ExpandableStringEnum { + /** Static value Auto for TrainingMode. */ + public static final TrainingMode AUTO = fromString("Auto"); + + /** Static value Distributed for TrainingMode. */ + public static final TrainingMode DISTRIBUTED = fromString("Distributed"); + + /** Static value NonDistributed for TrainingMode. */ + public static final TrainingMode NON_DISTRIBUTED = fromString("NonDistributed"); + + /** + * Creates a new instance of TrainingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrainingMode() { + } + + /** + * Creates or finds a TrainingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrainingMode. + */ + @JsonCreator + public static TrainingMode fromString(String name) { + return fromString(name, TrainingMode.class); + } + + /** + * Gets known TrainingMode values. + * + * @return known TrainingMode values. + */ + public static Collection values() { + return values(TrainingMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java index cade4da668652..5bac8aec11bf1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java @@ -55,6 +55,15 @@ public class TrainingSettings { @JsonProperty(value = "stackEnsembleSettings") private StackEnsembleSettings stackEnsembleSettings; + /* + * TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future + * may result in mixed mode or heuristics based mode selection. Default is 'auto'. + * If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. + * If 'NonDistributed' then only non distributed algorithms are chosen. + */ + @JsonProperty(value = "trainingMode") + private TrainingMode trainingMode; + /** Creates an instance of TrainingSettings class. */ public TrainingSettings() { } @@ -203,6 +212,32 @@ public TrainingSettings withStackEnsembleSettings(StackEnsembleSettings stackEns return this; } + /** + * Get the trainingMode property: TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' + * for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. If + * 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. If + * 'NonDistributed' then only non distributed algorithms are chosen. + * + * @return the trainingMode value. + */ + public TrainingMode trainingMode() { + return this.trainingMode; + } + + /** + * Set the trainingMode property: TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' + * for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. If + * 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. If + * 'NonDistributed' then only non distributed algorithms are chosen. + * + * @param trainingMode the trainingMode value to set. + * @return the TrainingSettings object itself. + */ + public TrainingSettings withTrainingMode(TrainingMode trainingMode) { + this.trainingMode = trainingMode; + return this; + } + /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonInferencingServer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonInferencingServer.java new file mode 100644 index 0000000000000..9b7239a43bb82 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonInferencingServer.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Triton inferencing server configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serverType") +@JsonTypeName("Triton") +@Fluent +public final class TritonInferencingServer extends InferencingServer { + /* + * Inference configuration for Triton. + */ + @JsonProperty(value = "inferenceConfiguration") + private OnlineInferenceConfiguration inferenceConfiguration; + + /** Creates an instance of TritonInferencingServer class. */ + public TritonInferencingServer() { + } + + /** + * Get the inferenceConfiguration property: Inference configuration for Triton. + * + * @return the inferenceConfiguration value. + */ + public OnlineInferenceConfiguration inferenceConfiguration() { + return this.inferenceConfiguration; + } + + /** + * Set the inferenceConfiguration property: Inference configuration for Triton. + * + * @param inferenceConfiguration the inferenceConfiguration value to set. + * @return the TritonInferencingServer object itself. + */ + public TritonInferencingServer withInferenceConfiguration(OnlineInferenceConfiguration inferenceConfiguration) { + this.inferenceConfiguration = inferenceConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (inferenceConfiguration() != null) { + inferenceConfiguration().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java index f7630d5f5c709..00411183df808 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("triton_model") @Fluent public final class TritonModelJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class TritonModelJobOutput extends JobOutput { public TritonModelJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the TritonModelJobOutput object itself. + */ + public TritonModelJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the TritonModelJobOutput object itself. + */ + public TritonModelJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the TritonModelJobOutput object itself. + */ + public TritonModelJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public TritonModelJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java index 0fe62c32561ae..62578ac00e0fd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java @@ -25,6 +25,27 @@ public UriFileDataVersion withDataUri(String dataUri) { return this; } + /** {@inheritDoc} */ + @Override + public UriFileDataVersion withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public UriFileDataVersion withStage(String stage) { + super.withStage(stage); + return this; + } + + /** {@inheritDoc} */ + @Override + public UriFileDataVersion withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public UriFileDataVersion withIsAnonymous(Boolean isAnonymous) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java index e59ccfb629ef3..415c33f9061d1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("uri_file") @Fluent public final class UriFileJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class UriFileJobOutput extends JobOutput { public UriFileJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the UriFileJobOutput object itself. + */ + public UriFileJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the UriFileJobOutput object itself. + */ + public UriFileJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the UriFileJobOutput object itself. + */ + public UriFileJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public UriFileJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java index 5904ef425eb8c..518abda5cc564 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java @@ -25,6 +25,27 @@ public UriFolderDataVersion withDataUri(String dataUri) { return this; } + /** {@inheritDoc} */ + @Override + public UriFolderDataVersion withIntellectualProperty(IntellectualProperty intellectualProperty) { + super.withIntellectualProperty(intellectualProperty); + return this; + } + + /** {@inheritDoc} */ + @Override + public UriFolderDataVersion withStage(String stage) { + super.withStage(stage); + return this; + } + + /** {@inheritDoc} */ + @Override + public UriFolderDataVersion withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + super.withAutoDeleteSetting(autoDeleteSetting); + return this; + } + /** {@inheritDoc} */ @Override public UriFolderDataVersion withIsAnonymous(Boolean isAnonymous) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java index c0a7ef31b48ff..439696da24923 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java @@ -14,6 +14,24 @@ @JsonTypeName("uri_folder") @Fluent public final class UriFolderJobOutput extends JobOutput { + /* + * Output Asset Name. + */ + @JsonProperty(value = "assetName") + private String assetName; + + /* + * Output Asset Version. + */ + @JsonProperty(value = "assetVersion") + private String assetVersion; + + /* + * Auto delete setting of output data asset. + */ + @JsonProperty(value = "autoDeleteSetting") + private AutoDeleteSetting autoDeleteSetting; + /* * Output Asset Delivery Mode. */ @@ -30,6 +48,66 @@ public final class UriFolderJobOutput extends JobOutput { public UriFolderJobOutput() { } + /** + * Get the assetName property: Output Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: Output Asset Name. + * + * @param assetName the assetName value to set. + * @return the UriFolderJobOutput object itself. + */ + public UriFolderJobOutput withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the assetVersion property: Output Asset Version. + * + * @return the assetVersion value. + */ + public String assetVersion() { + return this.assetVersion; + } + + /** + * Set the assetVersion property: Output Asset Version. + * + * @param assetVersion the assetVersion value to set. + * @return the UriFolderJobOutput object itself. + */ + public UriFolderJobOutput withAssetVersion(String assetVersion) { + this.assetVersion = assetVersion; + return this; + } + + /** + * Get the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @return the autoDeleteSetting value. + */ + public AutoDeleteSetting autoDeleteSetting() { + return this.autoDeleteSetting; + } + + /** + * Set the autoDeleteSetting property: Auto delete setting of output data asset. + * + * @param autoDeleteSetting the autoDeleteSetting value to set. + * @return the UriFolderJobOutput object itself. + */ + public UriFolderJobOutput withAutoDeleteSetting(AutoDeleteSetting autoDeleteSetting) { + this.autoDeleteSetting = autoDeleteSetting; + return this; + } + /** * Get the mode property: Output Asset Delivery Mode. * @@ -85,5 +163,8 @@ public UriFolderJobOutput withDescription(String description) { @Override public void validate() { super.validate(); + if (autoDeleteSetting() != null) { + autoDeleteSetting().validate(); + } } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java index efc6c81be31d6..e90b5cd6cf969 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java @@ -10,7 +10,7 @@ /** User assigned identity properties. */ @Immutable -public class UserAssignedIdentity { +public final class UserAssignedIdentity { /* * The principal ID of the assigned identity. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java new file mode 100644 index 0000000000000..7cabd36e60439 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserCreatedAcrAccount model. */ +@Fluent +public final class UserCreatedAcrAccount { + /* + * ARM ResourceId of a resource + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /** Creates an instance of UserCreatedAcrAccount class. */ + public UserCreatedAcrAccount() { + } + + /** + * Get the armResourceId property: ARM ResourceId of a resource. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: ARM ResourceId of a resource. + * + * @param armResourceId the armResourceId value to set. + * @return the UserCreatedAcrAccount object itself. + */ + public UserCreatedAcrAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java new file mode 100644 index 0000000000000..f23f2f94f4780 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserCreatedStorageAccount model. */ +@Fluent +public final class UserCreatedStorageAccount { + /* + * ARM ResourceId of a resource + */ + @JsonProperty(value = "armResourceId") + private ArmResourceId armResourceId; + + /** Creates an instance of UserCreatedStorageAccount class. */ + public UserCreatedStorageAccount() { + } + + /** + * Get the armResourceId property: ARM ResourceId of a resource. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: ARM ResourceId of a resource. + * + * @param armResourceId the armResourceId value to set. + * @return the UserCreatedStorageAccount object itself. + */ + public UserCreatedStorageAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java index bd76cf17193eb..f18505b812c3b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java @@ -12,7 +12,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "identityType") @JsonTypeName("UserIdentity") @Immutable -public class UserIdentity extends IdentityConfiguration { +public final class UserIdentity extends IdentityConfiguration { /** Creates an instance of UserIdentity class. */ public UserIdentity() { } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java index c63b03a2f6017..c99677dcf3a7b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The UsernamePasswordAuthTypeWorkspaceConnectionProperties model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") @@ -54,22 +55,22 @@ public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCategory(Connec /** {@inheritDoc} */ @Override - public UsernamePasswordAuthTypeWorkspaceConnectionProperties withTarget(String target) { - super.withTarget(target); + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); return this; } /** {@inheritDoc} */ @Override - public UsernamePasswordAuthTypeWorkspaceConnectionProperties withValue(String value) { - super.withValue(value); + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withMetadata(Object metadata) { + super.withMetadata(metadata); return this; } /** {@inheritDoc} */ @Override - public UsernamePasswordAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { - super.withValueFormat(valueFormat); + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java deleted file mode 100644 index 336be0e494447..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** format for the workspace connection value. */ -public final class ValueFormat extends ExpandableStringEnum { - /** Static value JSON for ValueFormat. */ - public static final ValueFormat JSON = fromString("JSON"); - - /** - * Creates a new instance of ValueFormat value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ValueFormat() { - } - - /** - * Creates or finds a ValueFormat from its string representation. - * - * @param name a name to look for. - * @return the corresponding ValueFormat. - */ - @JsonCreator - public static ValueFormat fromString(String name) { - return fromString(name, ValueFormat.class); - } - - /** - * Gets known ValueFormat values. - * - * @return known ValueFormat values. - */ - public static Collection values() { - return values(ValueFormat.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java new file mode 100644 index 0000000000000..e0e00bcfe34b0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VolumeDefinition model. */ +@Fluent +public final class VolumeDefinition { + /* + * Type of Volume Definition + * + * Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe + */ + @JsonProperty(value = "type") + private VolumeDefinitionType type; + + /* + * Indicate whether to mount volume as readOnly. Default value for this is false. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /* + * Source of the mount. For bind mounts this is the host path. + */ + @JsonProperty(value = "source") + private String source; + + /* + * Target of the mount. For bind mounts this is the path in the container. + */ + @JsonProperty(value = "target") + private String target; + + /* + * Consistency of the volume + */ + @JsonProperty(value = "consistency") + private String consistency; + + /* + * Bind Options of the mount + */ + @JsonProperty(value = "bind") + private BindOptions bind; + + /* + * Volume Options of the mount + */ + @JsonProperty(value = "volume") + private VolumeOptions volume; + + /* + * tmpfs option of the mount + */ + @JsonProperty(value = "tmpfs") + private TmpfsOptions tmpfs; + + /** Creates an instance of VolumeDefinition class. */ + public VolumeDefinition() { + } + + /** + * Get the type property: Type of Volume Definition + * + *

Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + * + * @return the type value. + */ + public VolumeDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Type of Volume Definition + * + *

Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + * + * @param type the type value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withType(VolumeDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the readOnly property: Indicate whether to mount volume as readOnly. Default value for this is false. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: Indicate whether to mount volume as readOnly. Default value for this is false. + * + * @param readOnly the readOnly value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the source property: Source of the mount. For bind mounts this is the host path. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source of the mount. For bind mounts this is the host path. + * + * @param source the source value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the target property: Target of the mount. For bind mounts this is the path in the container. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: Target of the mount. For bind mounts this is the path in the container. + * + * @param target the target value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the consistency property: Consistency of the volume. + * + * @return the consistency value. + */ + public String consistency() { + return this.consistency; + } + + /** + * Set the consistency property: Consistency of the volume. + * + * @param consistency the consistency value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withConsistency(String consistency) { + this.consistency = consistency; + return this; + } + + /** + * Get the bind property: Bind Options of the mount. + * + * @return the bind value. + */ + public BindOptions bind() { + return this.bind; + } + + /** + * Set the bind property: Bind Options of the mount. + * + * @param bind the bind value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withBind(BindOptions bind) { + this.bind = bind; + return this; + } + + /** + * Get the volume property: Volume Options of the mount. + * + * @return the volume value. + */ + public VolumeOptions volume() { + return this.volume; + } + + /** + * Set the volume property: Volume Options of the mount. + * + * @param volume the volume value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withVolume(VolumeOptions volume) { + this.volume = volume; + return this; + } + + /** + * Get the tmpfs property: tmpfs option of the mount. + * + * @return the tmpfs value. + */ + public TmpfsOptions tmpfs() { + return this.tmpfs; + } + + /** + * Set the tmpfs property: tmpfs option of the mount. + * + * @param tmpfs the tmpfs value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withTmpfs(TmpfsOptions tmpfs) { + this.tmpfs = tmpfs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bind() != null) { + bind().validate(); + } + if (volume() != null) { + volume().validate(); + } + if (tmpfs() != null) { + tmpfs().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java new file mode 100644 index 0000000000000..4b4a3ede0f642 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of Volume Definition + * + *

Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + */ +public final class VolumeDefinitionType extends ExpandableStringEnum { + /** Static value bind for VolumeDefinitionType. */ + public static final VolumeDefinitionType BIND = fromString("bind"); + + /** Static value volume for VolumeDefinitionType. */ + public static final VolumeDefinitionType VOLUME = fromString("volume"); + + /** Static value tmpfs for VolumeDefinitionType. */ + public static final VolumeDefinitionType TMPFS = fromString("tmpfs"); + + /** Static value npipe for VolumeDefinitionType. */ + public static final VolumeDefinitionType NPIPE = fromString("npipe"); + + /** + * Creates a new instance of VolumeDefinitionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeDefinitionType() { + } + + /** + * Creates or finds a VolumeDefinitionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeDefinitionType. + */ + @JsonCreator + public static VolumeDefinitionType fromString(String name) { + return fromString(name, VolumeDefinitionType.class); + } + + /** + * Gets known VolumeDefinitionType values. + * + * @return known VolumeDefinitionType values. + */ + public static Collection values() { + return values(VolumeDefinitionType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java new file mode 100644 index 0000000000000..8570820647d89 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VolumeOptions model. */ +@Fluent +public final class VolumeOptions { + /* + * Indicate whether volume is nocopy + */ + @JsonProperty(value = "nocopy") + private Boolean nocopy; + + /** Creates an instance of VolumeOptions class. */ + public VolumeOptions() { + } + + /** + * Get the nocopy property: Indicate whether volume is nocopy. + * + * @return the nocopy value. + */ + public Boolean nocopy() { + return this.nocopy; + } + + /** + * Set the nocopy property: Indicate whether volume is nocopy. + * + * @param nocopy the nocopy value to set. + * @return the VolumeOptions object itself. + */ + public VolumeOptions withNocopy(Boolean nocopy) { + this.nocopy = nocopy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java new file mode 100644 index 0000000000000..8de268e82fd5f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Webhook base. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "webhookType", + defaultImpl = Webhook.class) +@JsonTypeName("Webhook") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureDevOps", value = AzureDevOpsWebhook.class)}) +@Fluent +public class Webhook { + /* + * Send callback on a specified notification event + */ + @JsonProperty(value = "eventType") + private String eventType; + + /** Creates an instance of Webhook class. */ + public Webhook() { + } + + /** + * Get the eventType property: Send callback on a specified notification event. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: Send callback on a specified notification event. + * + * @param eventType the eventType value to set. + * @return the Webhook object itself. + */ + public Webhook withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java new file mode 100644 index 0000000000000..1e4a0081dd486 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum to determine the webhook callback service type. */ +public final class WebhookType extends ExpandableStringEnum { + /** Static value AzureDevOps for WebhookType. */ + public static final WebhookType AZURE_DEV_OPS = fromString("AzureDevOps"); + + /** + * Creates a new instance of WebhookType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookType() { + } + + /** + * Creates or finds a WebhookType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookType. + */ + @JsonCreator + public static WebhookType fromString(String name) { + return fromString(name, WebhookType.class); + } + + /** + * Gets known WebhookType values. + * + * @return known WebhookType values. + */ + public static Collection values() { + return values(WebhookType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java index 42e253da0269e..e13ea2445c8e5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java @@ -8,6 +8,7 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; import java.util.List; import java.util.Map; @@ -36,75 +37,76 @@ public interface Workspace { String type(); /** - * Gets the identity property: The identity of the resource. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * * @return the identity value. */ ManagedServiceIdentity identity(); /** - * Gets the location property: Specifies the location of the resource. + * Gets the kind property: The kind property. * - * @return the location value. + * @return the kind value. */ - String location(); + String kind(); /** - * Gets the tags property: Contains resource tags defined as key/value pairs. + * Gets the location property: The location property. * - * @return the tags value. + * @return the location value. */ - Map tags(); + String location(); /** - * Gets the sku property: The sku of the workspace. + * Gets the sku property: Optional. This field is required to be implemented by the RP because AML is supporting + * more than one tier. * * @return the sku value. */ Sku sku(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the tags property: Dictionary of <string>. * - * @return the systemData value. + * @return the tags value. */ - SystemData systemData(); + Map tags(); /** - * Gets the workspaceId property: The immutable id associated with this workspace. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the workspaceId value. + * @return the systemData value. */ - String workspaceId(); + SystemData systemData(); /** - * Gets the description property: The description of this workspace. + * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when + * behind VNet. * - * @return the description value. + * @return the allowPublicAccessWhenBehindVnet value. */ - String description(); + Boolean allowPublicAccessWhenBehindVnet(); /** - * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @return the friendlyName value. + * @return the applicationInsights value. */ - String friendlyName(); + String applicationInsights(); /** - * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Gets the associatedWorkspaces property: The associatedWorkspaces property. * - * @return the keyVault value. + * @return the associatedWorkspaces value. */ - String keyVault(); + List associatedWorkspaces(); /** - * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. + * Gets the containerRegistries property: The containerRegistries property. * - * @return the applicationInsights value. + * @return the containerRegistries value. */ - String applicationInsights(); + List containerRegistries(); /** * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. @@ -114,12 +116,11 @@ public interface Workspace { String containerRegistry(); /** - * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Gets the description property: The description of this workspace. * - * @return the storageAccount value. + * @return the description value. */ - String storageAccount(); + String description(); /** * Gets the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning @@ -130,20 +131,40 @@ public interface Workspace { String discoveryUrl(); /** - * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is - * to indicate states for resource provisioning. + * Gets the enableDataIsolation property: The enableDataIsolation property. * - * @return the provisioningState value. + * @return the enableDataIsolation value. */ - ProvisioningState provisioningState(); + Boolean enableDataIsolation(); /** - * Gets the encryption property: The encryption settings of Azure ML workspace. + * Gets the encryption property: The encryption property. * * @return the encryption value. */ EncryptionProperty encryption(); + /** + * Gets the existingWorkspaces property: The existingWorkspaces property. + * + * @return the existingWorkspaces value. + */ + List existingWorkspaces(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + String friendlyName(); + /** * Gets the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. @@ -153,41 +174,63 @@ public interface Workspace { Boolean hbiWorkspace(); /** - * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP - * in customer subscription if the workspace is CMK workspace. + * Gets the hubResourceId property: The hubResourceId property. * - * @return the serviceProvisionedResourceGroup value. + * @return the hubResourceId value. */ - String serviceProvisionedResourceGroup(); + String hubResourceId(); /** - * Gets the privateLinkCount property: Count of private connections in the workspace. + * Gets the imageBuildCompute property: The compute name for image build. * - * @return the privateLinkCount value. + * @return the imageBuildCompute value. */ - Integer privateLinkCount(); + String imageBuildCompute(); /** - * Gets the imageBuildCompute property: The compute name for image build. + * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @return the imageBuildCompute value. + * @return the keyVault value. */ - String imageBuildCompute(); + String keyVault(); /** - * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when - * behind VNet. + * Gets the keyVaults property: The keyVaults property. * - * @return the allowPublicAccessWhenBehindVnet value. + * @return the keyVaults value. */ - Boolean allowPublicAccessWhenBehindVnet(); + List keyVaults(); /** - * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the publicNetworkAccess value. + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point + * at to set up tracking. + * + * @return the mlFlowTrackingUri value. + */ + String mlFlowTrackingUri(); + + /** + * Gets the notebookInfo property: The notebook info of Azure ML workspace. + * + * @return the notebookInfo value. */ - PublicNetworkAccess publicNetworkAccess(); + NotebookResourceInfo notebookInfo(); + + /** + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + String primaryUserAssignedIdentity(); /** * Gets the privateEndpointConnections property: The list of private endpoint connections in the workspace. @@ -197,18 +240,26 @@ public interface Workspace { List privateEndpointConnections(); /** - * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Gets the privateLinkCount property: Count of private connections in the workspace. * - * @return the sharedPrivateLinkResources value. + * @return the privateLinkCount value. */ - List sharedPrivateLinkResources(); + Integer privateLinkCount(); /** - * Gets the notebookInfo property: The notebook info of Azure ML workspace. + * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is + * to indicate states for resource provisioning. * - * @return the notebookInfo value. + * @return the provisioningState value. */ - NotebookResourceInfo notebookInfo(); + ProvisioningState provisioningState(); + + /** + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessType publicNetworkAccess(); /** * Gets the serviceManagedResourcesSettings property: The service managed resource settings. @@ -218,19 +269,41 @@ public interface Workspace { ServiceManagedResourcesSettings serviceManagedResourcesSettings(); /** - * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP + * in customer subscription if the workspace is CMK workspace. * - * @return the primaryUserAssignedIdentity value. + * @return the serviceProvisionedResourceGroup value. */ - String primaryUserAssignedIdentity(); + String serviceProvisionedResourceGroup(); /** - * Gets the tenantId property: The tenant id associated with this workspace. + * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. * - * @return the tenantId value. + * @return the sharedPrivateLinkResources value. */ - String tenantId(); + List sharedPrivateLinkResources(); + + /** + * Gets the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @return the softDeleteRetentionInDays value. + */ + Integer softDeleteRetentionInDays(); + + /** + * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @return the storageAccount value. + */ + String storageAccount(); + + /** + * Gets the storageAccounts property: The storageAccounts property. + * + * @return the storageAccounts value. + */ + List storageAccounts(); /** * Gets the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS) @@ -241,12 +314,19 @@ public interface Workspace { Boolean storageHnsEnabled(); /** - * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point - * at to set up tracking. + * Gets the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. * - * @return the mlFlowTrackingUri value. + * @return the systemDatastoresAuthMode value. */ - String mlFlowTrackingUri(); + String systemDatastoresAuthMode(); + + /** + * Gets the tenantId property: The tenant id associated with this workspace. + * + * @return the tenantId value. + */ + String tenantId(); /** * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 @@ -256,6 +336,20 @@ public interface Workspace { */ Boolean v1LegacyMode(); + /** + * Gets the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + WorkspaceHubConfig workspaceHubConfig(); + + /** + * Gets the workspaceId property: The immutable id associated with this workspace. + * + * @return the workspaceId value. + */ + String workspaceId(); + /** * Gets the region of the resource. * @@ -288,11 +382,13 @@ public interface Workspace { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Workspace definition stages. */ interface DefinitionStages { /** The first stage of the Workspace definition. */ interface Blank extends WithResourceGroup { } + /** The stage of the Workspace definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -303,6 +399,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Workspace definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -311,23 +408,36 @@ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku, - DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithKeyVault, + DefinitionStages.WithAllowPublicAccessWhenBehindVnet, DefinitionStages.WithApplicationInsights, + DefinitionStages.WithAssociatedWorkspaces, + DefinitionStages.WithContainerRegistries, DefinitionStages.WithContainerRegistry, - DefinitionStages.WithStorageAccount, + DefinitionStages.WithDescription, DefinitionStages.WithDiscoveryUrl, + DefinitionStages.WithEnableDataIsolation, DefinitionStages.WithEncryption, + DefinitionStages.WithExistingWorkspaces, + DefinitionStages.WithFeatureStoreSettings, + DefinitionStages.WithFriendlyName, DefinitionStages.WithHbiWorkspace, + DefinitionStages.WithHubResourceId, DefinitionStages.WithImageBuildCompute, - DefinitionStages.WithAllowPublicAccessWhenBehindVnet, + DefinitionStages.WithKeyVault, + DefinitionStages.WithKeyVaults, + DefinitionStages.WithManagedNetwork, + DefinitionStages.WithPrimaryUserAssignedIdentity, DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithSharedPrivateLinkResources, DefinitionStages.WithServiceManagedResourcesSettings, - DefinitionStages.WithPrimaryUserAssignedIdentity, - DefinitionStages.WithV1LegacyMode { + DefinitionStages.WithSharedPrivateLinkResources, + DefinitionStages.WithSoftDeleteRetentionInDays, + DefinitionStages.WithStorageAccount, + DefinitionStages.WithStorageAccounts, + DefinitionStages.WithSystemDatastoresAuthMode, + DefinitionStages.WithV1LegacyMode, + DefinitionStages.WithWorkspaceHubConfig { /** * Executes the create request. * @@ -343,12 +453,13 @@ interface WithCreate */ Workspace create(Context context); } + /** The stage of the Workspace definition allowing to specify location. */ interface WithLocation { /** * Specifies the region for the resource. * - * @param location Specifies the location of the resource. + * @param location The location property. * @return the next definition stage. */ WithCreate withRegion(Region location); @@ -356,84 +467,106 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location Specifies the location of the resource. + * @param location The location property. * @return the next definition stage. */ WithCreate withRegion(String location); } + /** The stage of the Workspace definition allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Contains resource tags defined as key/value pairs.. + * Specifies the tags property: Dictionary of <string>. * - * @param tags Contains resource tags defined as key/value pairs. + * @param tags Dictionary of <string>. * @return the next definition stage. */ WithCreate withTags(Map tags); } + /** The stage of the Workspace definition allowing to specify identity. */ interface WithIdentity { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). * - * @param identity The identity of the resource. + * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } + + /** The stage of the Workspace definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind property.. + * + * @param kind The kind property. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + /** The stage of the Workspace definition allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: The sku of the workspace.. + * Specifies the sku property: Optional. This field is required to be implemented by the RP because AML is + * supporting more than one tier. * - * @param sku The sku of the workspace. + * @param sku Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * @return the next definition stage. */ WithCreate withSku(Sku sku); } - /** The stage of the Workspace definition allowing to specify description. */ - interface WithDescription { + + /** The stage of the Workspace definition allowing to specify allowPublicAccessWhenBehindVnet. */ + interface WithAllowPublicAccessWhenBehindVnet { /** - * Specifies the description property: The description of this workspace.. + * Specifies the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public + * access when behind VNet.. * - * @param description The description of this workspace. + * @param allowPublicAccessWhenBehindVnet The flag to indicate whether to allow public access when behind + * VNet. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet); } - /** The stage of the Workspace definition allowing to specify friendlyName. */ - interface WithFriendlyName { + + /** The stage of the Workspace definition allowing to specify applicationInsights. */ + interface WithApplicationInsights { /** - * Specifies the friendlyName property: The friendly name for this workspace. This name in mutable. + * Specifies the applicationInsights property: ARM id of the application insights associated with this + * workspace.. * - * @param friendlyName The friendly name for this workspace. This name in mutable. + * @param applicationInsights ARM id of the application insights associated with this workspace. * @return the next definition stage. */ - WithCreate withFriendlyName(String friendlyName); + WithCreate withApplicationInsights(String applicationInsights); } - /** The stage of the Workspace definition allowing to specify keyVault. */ - interface WithKeyVault { + + /** The stage of the Workspace definition allowing to specify associatedWorkspaces. */ + interface WithAssociatedWorkspaces { /** - * Specifies the keyVault property: ARM id of the key vault associated with this workspace. This cannot be - * changed once the workspace has been created. + * Specifies the associatedWorkspaces property: The associatedWorkspaces property.. * - * @param keyVault ARM id of the key vault associated with this workspace. This cannot be changed once the - * workspace has been created. + * @param associatedWorkspaces The associatedWorkspaces property. * @return the next definition stage. */ - WithCreate withKeyVault(String keyVault); + WithCreate withAssociatedWorkspaces(List associatedWorkspaces); } - /** The stage of the Workspace definition allowing to specify applicationInsights. */ - interface WithApplicationInsights { + + /** The stage of the Workspace definition allowing to specify containerRegistries. */ + interface WithContainerRegistries { /** - * Specifies the applicationInsights property: ARM id of the application insights associated with this - * workspace.. + * Specifies the containerRegistries property: The containerRegistries property.. * - * @param applicationInsights ARM id of the application insights associated with this workspace. + * @param containerRegistries The containerRegistries property. * @return the next definition stage. */ - WithCreate withApplicationInsights(String applicationInsights); + WithCreate withContainerRegistries(List containerRegistries); } + /** The stage of the Workspace definition allowing to specify containerRegistry. */ interface WithContainerRegistry { /** @@ -445,18 +578,18 @@ interface WithContainerRegistry { */ WithCreate withContainerRegistry(String containerRegistry); } - /** The stage of the Workspace definition allowing to specify storageAccount. */ - interface WithStorageAccount { + + /** The stage of the Workspace definition allowing to specify description. */ + interface WithDescription { /** - * Specifies the storageAccount property: ARM id of the storage account associated with this workspace. This - * cannot be changed once the workspace has been created. + * Specifies the description property: The description of this workspace.. * - * @param storageAccount ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * @param description The description of this workspace. * @return the next definition stage. */ - WithCreate withStorageAccount(String storageAccount); + WithCreate withDescription(String description); } + /** The stage of the Workspace definition allowing to specify discoveryUrl. */ interface WithDiscoveryUrl { /** @@ -469,16 +602,62 @@ interface WithDiscoveryUrl { */ WithCreate withDiscoveryUrl(String discoveryUrl); } + + /** The stage of the Workspace definition allowing to specify enableDataIsolation. */ + interface WithEnableDataIsolation { + /** + * Specifies the enableDataIsolation property: The enableDataIsolation property.. + * + * @param enableDataIsolation The enableDataIsolation property. + * @return the next definition stage. + */ + WithCreate withEnableDataIsolation(Boolean enableDataIsolation); + } + /** The stage of the Workspace definition allowing to specify encryption. */ interface WithEncryption { /** - * Specifies the encryption property: The encryption settings of Azure ML workspace.. + * Specifies the encryption property: The encryption property.. + * + * @param encryption The encryption property. + * @return the next definition stage. + */ + WithCreate withEncryption(EncryptionProperty encryption); + } + + /** The stage of the Workspace definition allowing to specify existingWorkspaces. */ + interface WithExistingWorkspaces { + /** + * Specifies the existingWorkspaces property: The existingWorkspaces property.. + * + * @param existingWorkspaces The existingWorkspaces property. + * @return the next definition stage. + */ + WithCreate withExistingWorkspaces(List existingWorkspaces); + } + + /** The stage of the Workspace definition allowing to specify featureStoreSettings. */ + interface WithFeatureStoreSettings { + /** + * Specifies the featureStoreSettings property: Settings for feature store type workspace.. + * + * @param featureStoreSettings Settings for feature store type workspace. + * @return the next definition stage. + */ + WithCreate withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings); + } + + /** The stage of the Workspace definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: The friendly name for this workspace. This name in mutable. * - * @param encryption The encryption settings of Azure ML workspace. + * @param friendlyName The friendly name for this workspace. This name in mutable. * @return the next definition stage. */ - WithCreate withEncryption(EncryptionProperty encryption); + WithCreate withFriendlyName(String friendlyName); } + /** The stage of the Workspace definition allowing to specify hbiWorkspace. */ interface WithHbiWorkspace { /** @@ -491,6 +670,18 @@ interface WithHbiWorkspace { */ WithCreate withHbiWorkspace(Boolean hbiWorkspace); } + + /** The stage of the Workspace definition allowing to specify hubResourceId. */ + interface WithHubResourceId { + /** + * Specifies the hubResourceId property: The hubResourceId property.. + * + * @param hubResourceId The hubResourceId property. + * @return the next definition stage. + */ + WithCreate withHubResourceId(String hubResourceId); + } + /** The stage of the Workspace definition allowing to specify imageBuildCompute. */ interface WithImageBuildCompute { /** @@ -501,18 +692,55 @@ interface WithImageBuildCompute { */ WithCreate withImageBuildCompute(String imageBuildCompute); } - /** The stage of the Workspace definition allowing to specify allowPublicAccessWhenBehindVnet. */ - interface WithAllowPublicAccessWhenBehindVnet { + + /** The stage of the Workspace definition allowing to specify keyVault. */ + interface WithKeyVault { /** - * Specifies the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public - * access when behind VNet.. + * Specifies the keyVault property: ARM id of the key vault associated with this workspace. This cannot be + * changed once the workspace has been created. * - * @param allowPublicAccessWhenBehindVnet The flag to indicate whether to allow public access when behind - * VNet. + * @param keyVault ARM id of the key vault associated with this workspace. This cannot be changed once the + * workspace has been created. * @return the next definition stage. */ - WithCreate withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet); + WithCreate withKeyVault(String keyVault); + } + + /** The stage of the Workspace definition allowing to specify keyVaults. */ + interface WithKeyVaults { + /** + * Specifies the keyVaults property: The keyVaults property.. + * + * @param keyVaults The keyVaults property. + * @return the next definition stage. + */ + WithCreate withKeyVaults(List keyVaults); + } + + /** The stage of the Workspace definition allowing to specify managedNetwork. */ + interface WithManagedNetwork { + /** + * Specifies the managedNetwork property: Managed Network settings for a machine learning workspace.. + * + * @param managedNetwork Managed Network settings for a machine learning workspace. + * @return the next definition stage. + */ + WithCreate withManagedNetwork(ManagedNetworkSettingsInner managedNetwork); + } + + /** The stage of the Workspace definition allowing to specify primaryUserAssignedIdentity. */ + interface WithPrimaryUserAssignedIdentity { + /** + * Specifies the primaryUserAssignedIdentity property: The user assigned identity resource id that + * represents the workspace identity.. + * + * @param primaryUserAssignedIdentity The user assigned identity resource id that represents the workspace + * identity. + * @return the next definition stage. + */ + WithCreate withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity); } + /** The stage of the Workspace definition allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** @@ -521,8 +749,21 @@ interface WithPublicNetworkAccess { * @param publicNetworkAccess Whether requests from Public Network are allowed. * @return the next definition stage. */ - WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + WithCreate withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess); + } + + /** The stage of the Workspace definition allowing to specify serviceManagedResourcesSettings. */ + interface WithServiceManagedResourcesSettings { + /** + * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. + * + * @param serviceManagedResourcesSettings The service managed resource settings. + * @return the next definition stage. + */ + WithCreate withServiceManagedResourcesSettings( + ServiceManagedResourcesSettings serviceManagedResourcesSettings); } + /** The stage of the Workspace definition allowing to specify sharedPrivateLinkResources. */ interface WithSharedPrivateLinkResources { /** @@ -534,29 +775,55 @@ interface WithSharedPrivateLinkResources { */ WithCreate withSharedPrivateLinkResources(List sharedPrivateLinkResources); } - /** The stage of the Workspace definition allowing to specify serviceManagedResourcesSettings. */ - interface WithServiceManagedResourcesSettings { + + /** The stage of the Workspace definition allowing to specify softDeleteRetentionInDays. */ + interface WithSoftDeleteRetentionInDays { /** - * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. + * Specifies the softDeleteRetentionInDays property: Retention time in days after workspace get soft + * deleted.. * - * @param serviceManagedResourcesSettings The service managed resource settings. + * @param softDeleteRetentionInDays Retention time in days after workspace get soft deleted. * @return the next definition stage. */ - WithCreate withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings); + WithCreate withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays); } - /** The stage of the Workspace definition allowing to specify primaryUserAssignedIdentity. */ - interface WithPrimaryUserAssignedIdentity { + + /** The stage of the Workspace definition allowing to specify storageAccount. */ + interface WithStorageAccount { /** - * Specifies the primaryUserAssignedIdentity property: The user assigned identity resource id that - * represents the workspace identity.. + * Specifies the storageAccount property: ARM id of the storage account associated with this workspace. This + * cannot be changed once the workspace has been created. * - * @param primaryUserAssignedIdentity The user assigned identity resource id that represents the workspace - * identity. + * @param storageAccount ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. * @return the next definition stage. */ - WithCreate withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity); + WithCreate withStorageAccount(String storageAccount); + } + + /** The stage of the Workspace definition allowing to specify storageAccounts. */ + interface WithStorageAccounts { + /** + * Specifies the storageAccounts property: The storageAccounts property.. + * + * @param storageAccounts The storageAccounts property. + * @return the next definition stage. + */ + WithCreate withStorageAccounts(List storageAccounts); + } + + /** The stage of the Workspace definition allowing to specify systemDatastoresAuthMode. */ + interface WithSystemDatastoresAuthMode { + /** + * Specifies the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores + * of the workspace.. + * + * @param systemDatastoresAuthMode The auth mode used for accessing the system datastores of the workspace. + * @return the next definition stage. + */ + WithCreate withSystemDatastoresAuthMode(String systemDatastoresAuthMode); } + /** The stage of the Workspace definition allowing to specify v1LegacyMode. */ interface WithV1LegacyMode { /** @@ -568,7 +835,19 @@ interface WithV1LegacyMode { */ WithCreate withV1LegacyMode(Boolean v1LegacyMode); } + + /** The stage of the Workspace definition allowing to specify workspaceHubConfig. */ + interface WithWorkspaceHubConfig { + /** + * Specifies the workspaceHubConfig property: WorkspaceHub's configuration object.. + * + * @param workspaceHubConfig WorkspaceHub's configuration object. + * @return the next definition stage. + */ + WithCreate withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig); + } } + /** * Begins update for the Workspace resource. * @@ -579,16 +858,22 @@ interface WithV1LegacyMode { /** The template for Workspace update. */ interface Update extends UpdateStages.WithTags, - UpdateStages.WithSku, UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithApplicationInsights, + UpdateStages.WithContainerRegistry, UpdateStages.WithDescription, + UpdateStages.WithEnableDataIsolation, + UpdateStages.WithEncryption, + UpdateStages.WithFeatureStoreSettings, UpdateStages.WithFriendlyName, UpdateStages.WithImageBuildCompute, - UpdateStages.WithServiceManagedResourcesSettings, + UpdateStages.WithManagedNetwork, UpdateStages.WithPrimaryUserAssignedIdentity, UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithApplicationInsights, - UpdateStages.WithContainerRegistry { + UpdateStages.WithServiceManagedResourcesSettings, + UpdateStages.WithSoftDeleteRetentionInDays, + UpdateStages.WithV1LegacyMode { /** * Executes the update request. * @@ -604,6 +889,7 @@ interface Update */ Workspace apply(Context context); } + /** The Workspace update stages. */ interface UpdateStages { /** The stage of the Workspace update allowing to specify tags. */ @@ -616,26 +902,56 @@ interface WithTags { */ Update withTags(Map tags); } + + /** The stage of the Workspace update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Workspace update allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: The sku of the workspace.. + * Specifies the sku property: Optional. This field is required to be implemented by the RP because AML is + * supporting more than one tier. * - * @param sku The sku of the workspace. + * @param sku Optional. This field is required to be implemented by the RP because AML is supporting more + * than one tier. * @return the next definition stage. */ Update withSku(Sku sku); } - /** The stage of the Workspace update allowing to specify identity. */ - interface WithIdentity { + + /** The stage of the Workspace update allowing to specify applicationInsights. */ + interface WithApplicationInsights { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the applicationInsights property: ARM id of the application insights associated with this + * workspace.. * - * @param identity The identity of the resource. + * @param applicationInsights ARM id of the application insights associated with this workspace. * @return the next definition stage. */ - Update withIdentity(ManagedServiceIdentity identity); + Update withApplicationInsights(String applicationInsights); + } + + /** The stage of the Workspace update allowing to specify containerRegistry. */ + interface WithContainerRegistry { + /** + * Specifies the containerRegistry property: ARM id of the container registry associated with this + * workspace.. + * + * @param containerRegistry ARM id of the container registry associated with this workspace. + * @return the next definition stage. + */ + Update withContainerRegistry(String containerRegistry); } + /** The stage of the Workspace update allowing to specify description. */ interface WithDescription { /** @@ -646,16 +962,51 @@ interface WithDescription { */ Update withDescription(String description); } + + /** The stage of the Workspace update allowing to specify enableDataIsolation. */ + interface WithEnableDataIsolation { + /** + * Specifies the enableDataIsolation property: The enableDataIsolation property.. + * + * @param enableDataIsolation The enableDataIsolation property. + * @return the next definition stage. + */ + Update withEnableDataIsolation(Boolean enableDataIsolation); + } + + /** The stage of the Workspace update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption property.. + * + * @param encryption The encryption property. + * @return the next definition stage. + */ + Update withEncryption(EncryptionUpdateProperties encryption); + } + + /** The stage of the Workspace update allowing to specify featureStoreSettings. */ + interface WithFeatureStoreSettings { + /** + * Specifies the featureStoreSettings property: Settings for feature store type workspace.. + * + * @param featureStoreSettings Settings for feature store type workspace. + * @return the next definition stage. + */ + Update withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings); + } + /** The stage of the Workspace update allowing to specify friendlyName. */ interface WithFriendlyName { /** - * Specifies the friendlyName property: The friendly name for this workspace.. + * Specifies the friendlyName property: The friendly name for this workspace. This name in mutable. * - * @param friendlyName The friendly name for this workspace. + * @param friendlyName The friendly name for this workspace. This name in mutable. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } + /** The stage of the Workspace update allowing to specify imageBuildCompute. */ interface WithImageBuildCompute { /** @@ -666,16 +1017,18 @@ interface WithImageBuildCompute { */ Update withImageBuildCompute(String imageBuildCompute); } - /** The stage of the Workspace update allowing to specify serviceManagedResourcesSettings. */ - interface WithServiceManagedResourcesSettings { + + /** The stage of the Workspace update allowing to specify managedNetwork. */ + interface WithManagedNetwork { /** - * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. + * Specifies the managedNetwork property: Managed Network settings for a machine learning workspace.. * - * @param serviceManagedResourcesSettings The service managed resource settings. + * @param managedNetwork Managed Network settings for a machine learning workspace. * @return the next definition stage. */ - Update withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings); + Update withManagedNetwork(ManagedNetworkSettingsInner managedNetwork); } + /** The stage of the Workspace update allowing to specify primaryUserAssignedIdentity. */ interface WithPrimaryUserAssignedIdentity { /** @@ -688,6 +1041,7 @@ interface WithPrimaryUserAssignedIdentity { */ Update withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity); } + /** The stage of the Workspace update allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** @@ -696,31 +1050,45 @@ interface WithPublicNetworkAccess { * @param publicNetworkAccess Whether requests from Public Network are allowed. * @return the next definition stage. */ - Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + Update withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess); } - /** The stage of the Workspace update allowing to specify applicationInsights. */ - interface WithApplicationInsights { + + /** The stage of the Workspace update allowing to specify serviceManagedResourcesSettings. */ + interface WithServiceManagedResourcesSettings { /** - * Specifies the applicationInsights property: ARM id of the application insights associated with this - * workspace.. + * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. * - * @param applicationInsights ARM id of the application insights associated with this workspace. + * @param serviceManagedResourcesSettings The service managed resource settings. * @return the next definition stage. */ - Update withApplicationInsights(String applicationInsights); + Update withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings); } - /** The stage of the Workspace update allowing to specify containerRegistry. */ - interface WithContainerRegistry { + + /** The stage of the Workspace update allowing to specify softDeleteRetentionInDays. */ + interface WithSoftDeleteRetentionInDays { /** - * Specifies the containerRegistry property: ARM id of the container registry associated with this - * workspace.. + * Specifies the softDeleteRetentionInDays property: Retention time in days after workspace get soft + * deleted.. * - * @param containerRegistry ARM id of the container registry associated with this workspace. + * @param softDeleteRetentionInDays Retention time in days after workspace get soft deleted. * @return the next definition stage. */ - Update withContainerRegistry(String containerRegistry); + Update withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays); + } + + /** The stage of the Workspace update allowing to specify v1LegacyMode. */ + interface WithV1LegacyMode { + /** + * Specifies the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided + * by the v2 API.. + * + * @param v1LegacyMode Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + * @return the next definition stage. + */ + Update withV1LegacyMode(Boolean v1LegacyMode); } } + /** * Refreshes the resource to sync with Azure. * @@ -748,14 +1116,14 @@ interface WithContainerRegistry { /** * Diagnose workspace setup issue. * - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - DiagnoseResponseResult diagnose(DiagnoseWorkspaceParameters parameters, Context context); + DiagnoseResponseResult diagnose(DiagnoseWorkspaceParameters body, Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and @@ -780,27 +1148,27 @@ interface WithContainerRegistry { ListWorkspaceKeysResult listKeys(); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Machine Learning Workspace notebook access token along with {@link Response}. */ - void resyncKeys(); + Response listNotebookAccessTokenWithResponse(Context context); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Machine Learning Workspace notebook access token. */ - void resyncKeys(Context context); + NotebookAccessTokenResult listNotebookAccessToken(); /** - * return notebook access token and refresh token. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -808,74 +1176,74 @@ interface WithContainerRegistry { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listNotebookAccessTokenWithResponse(Context context); + Response listNotebookKeysWithResponse(Context context); /** - * return notebook access token and refresh token. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - NotebookAccessTokenResult listNotebookAccessToken(); + ListNotebookKeysResult listNotebookKeys(); /** - * Prepare a notebook. + * Lists keys of Azure Machine Learning Workspace's storage account. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - NotebookResourceInfo prepareNotebook(); + Response listStorageAccountKeysWithResponse(Context context); /** - * Prepare a notebook. + * Lists keys of Azure Machine Learning Workspace's storage account. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - NotebookResourceInfo prepareNotebook(Context context); + ListStorageAccountKeysResult listStorageAccountKeys(); /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response listStorageAccountKeysWithResponse(Context context); + NotebookResourceInfo prepareNotebook(); /** - * List storage account keys of a workspace. + * Prepare Azure Machine Learning Workspace's notebook resource. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - ListStorageAccountKeysResult listStorageAccountKeys(); + NotebookResourceInfo prepareNotebook(Context context); /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. */ - Response listNotebookKeysWithResponse(Context context); + void resyncKeys(); /** - * List keys of a notebook. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - ListNotebookKeysResult listNotebookKeys(); + void resyncKeys(Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java new file mode 100644 index 0000000000000..4240428879e13 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkspaceConnectionAccessKey model. */ +@Fluent +public final class WorkspaceConnectionAccessKey { + /* + * The accessKeyId property. + */ + @JsonProperty(value = "accessKeyId") + private String accessKeyId; + + /* + * The secretAccessKey property. + */ + @JsonProperty(value = "secretAccessKey") + private String secretAccessKey; + + /** Creates an instance of WorkspaceConnectionAccessKey class. */ + public WorkspaceConnectionAccessKey() { + } + + /** + * Get the accessKeyId property: The accessKeyId property. + * + * @return the accessKeyId value. + */ + public String accessKeyId() { + return this.accessKeyId; + } + + /** + * Set the accessKeyId property: The accessKeyId property. + * + * @param accessKeyId the accessKeyId value to set. + * @return the WorkspaceConnectionAccessKey object itself. + */ + public WorkspaceConnectionAccessKey withAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get the secretAccessKey property: The secretAccessKey property. + * + * @return the secretAccessKey value. + */ + public String secretAccessKey() { + return this.secretAccessKey; + } + + /** + * Set the secretAccessKey property: The secretAccessKey property. + * + * @param secretAccessKey the secretAccessKey value to set. + * @return the WorkspaceConnectionAccessKey object itself. + */ + public WorkspaceConnectionAccessKey withSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java new file mode 100644 index 0000000000000..40433c9146f97 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Api key object for workspace connection credential. */ +@Fluent +public final class WorkspaceConnectionApiKey { + /* + * The key property. + */ + @JsonProperty(value = "key") + private String key; + + /** Creates an instance of WorkspaceConnectionApiKey class. */ + public WorkspaceConnectionApiKey() { + } + + /** + * Get the key property: The key property. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key property. + * + * @param key the key value to set. + * @return the WorkspaceConnectionApiKey object itself. + */ + public WorkspaceConnectionApiKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java index 8f7d813b83b87..58a6430c84ac5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java @@ -9,60 +9,60 @@ /** The WorkspaceConnectionManagedIdentity model. */ @Fluent -public class WorkspaceConnectionManagedIdentity { - /* - * The resourceId property. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - +public final class WorkspaceConnectionManagedIdentity { /* * The clientId property. */ @JsonProperty(value = "clientId") private String clientId; + /* + * The resourceId property. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + /** Creates an instance of WorkspaceConnectionManagedIdentity class. */ public WorkspaceConnectionManagedIdentity() { } /** - * Get the resourceId property: The resourceId property. + * Get the clientId property: The clientId property. * - * @return the resourceId value. + * @return the clientId value. */ - public String resourceId() { - return this.resourceId; + public String clientId() { + return this.clientId; } /** - * Set the resourceId property: The resourceId property. + * Set the clientId property: The clientId property. * - * @param resourceId the resourceId value to set. + * @param clientId the clientId value to set. * @return the WorkspaceConnectionManagedIdentity object itself. */ - public WorkspaceConnectionManagedIdentity withResourceId(String resourceId) { - this.resourceId = resourceId; + public WorkspaceConnectionManagedIdentity withClientId(String clientId) { + this.clientId = clientId; return this; } /** - * Get the clientId property: The clientId property. + * Get the resourceId property: The resourceId property. * - * @return the clientId value. + * @return the resourceId value. */ - public String clientId() { - return this.clientId; + public String resourceId() { + return this.resourceId; } /** - * Set the clientId property: The clientId property. + * Set the resourceId property: The resourceId property. * - * @param clientId the clientId value to set. + * @param resourceId the resourceId value to set. * @return the WorkspaceConnectionManagedIdentity object itself. */ - public WorkspaceConnectionManagedIdentity withClientId(String clientId) { - this.clientId = clientId; + public WorkspaceConnectionManagedIdentity withResourceId(String resourceId) { + this.resourceId = resourceId; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java index a0a871c9c248b..2edd7d6631913 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; /** The WorkspaceConnectionPropertiesV2 model. */ @JsonTypeInfo( @@ -18,11 +19,15 @@ defaultImpl = WorkspaceConnectionPropertiesV2.class) @JsonTypeName("WorkspaceConnectionPropertiesV2") @JsonSubTypes({ + @JsonSubTypes.Type(name = "AccessKey", value = AccessKeyAuthTypeWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "ApiKey", value = ApiKeyAuthWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "CustomKeys", value = CustomKeysWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "ManagedIdentity", value = ManagedIdentityAuthTypeWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "None", value = NoneAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "PAT", value = PatAuthTypeWorkspaceConnectionProperties.class), @JsonSubTypes.Type(name = "SAS", value = SasAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "UsernamePassword", value = UsernamePasswordAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "None", value = NoneAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "ManagedIdentity", value = ManagedIdentityAuthTypeWorkspaceConnectionProperties.class) + @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalAuthTypeWorkspaceConnectionProperties.class), + @JsonSubTypes.Type(name = "UsernamePassword", value = UsernamePasswordAuthTypeWorkspaceConnectionProperties.class) }) @Fluent public class WorkspaceConnectionPropertiesV2 { @@ -33,22 +38,22 @@ public class WorkspaceConnectionPropertiesV2 { private ConnectionCategory category; /* - * The target property. + * The expiryTime property. */ - @JsonProperty(value = "target") - private String target; + @JsonProperty(value = "expiryTime") + private OffsetDateTime expiryTime; /* - * Value details of the workspace connection. + * Any object */ - @JsonProperty(value = "value") - private String value; + @JsonProperty(value = "metadata") + private Object metadata; /* - * format for the workspace connection value + * The target property. */ - @JsonProperty(value = "valueFormat") - private ValueFormat valueFormat; + @JsonProperty(value = "target") + private String target; /** Creates an instance of WorkspaceConnectionPropertiesV2 class. */ public WorkspaceConnectionPropertiesV2() { @@ -75,62 +80,62 @@ public WorkspaceConnectionPropertiesV2 withCategory(ConnectionCategory category) } /** - * Get the target property: The target property. + * Get the expiryTime property: The expiryTime property. * - * @return the target value. + * @return the expiryTime value. */ - public String target() { - return this.target; + public OffsetDateTime expiryTime() { + return this.expiryTime; } /** - * Set the target property: The target property. + * Set the expiryTime property: The expiryTime property. * - * @param target the target value to set. + * @param expiryTime the expiryTime value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ - public WorkspaceConnectionPropertiesV2 withTarget(String target) { - this.target = target; + public WorkspaceConnectionPropertiesV2 withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; return this; } /** - * Get the value property: Value details of the workspace connection. + * Get the metadata property: Any object. * - * @return the value value. + * @return the metadata value. */ - public String value() { - return this.value; + public Object metadata() { + return this.metadata; } /** - * Set the value property: Value details of the workspace connection. + * Set the metadata property: Any object. * - * @param value the value value to set. + * @param metadata the metadata value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ - public WorkspaceConnectionPropertiesV2 withValue(String value) { - this.value = value; + public WorkspaceConnectionPropertiesV2 withMetadata(Object metadata) { + this.metadata = metadata; return this; } /** - * Get the valueFormat property: format for the workspace connection value. + * Get the target property: The target property. * - * @return the valueFormat value. + * @return the target value. */ - public ValueFormat valueFormat() { - return this.valueFormat; + public String target() { + return this.target; } /** - * Set the valueFormat property: format for the workspace connection value. + * Set the target property: The target property. * - * @param valueFormat the valueFormat value to set. + * @param target the target value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ - public WorkspaceConnectionPropertiesV2 withValueFormat(ValueFormat valueFormat) { - this.valueFormat = valueFormat; + public WorkspaceConnectionPropertiesV2 withTarget(String target) { + this.target = target; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java index 22ef3cb48926e..70904da101593 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; @@ -45,6 +46,13 @@ public interface WorkspaceConnectionPropertiesV2BasicResource { */ SystemData systemData(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner * com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner object. @@ -60,11 +68,13 @@ interface Definition DefinitionStages.WithProperties, DefinitionStages.WithCreate { } + /** The WorkspaceConnectionPropertiesV2BasicResource definition stages. */ interface DefinitionStages { /** The first stage of the WorkspaceConnectionPropertiesV2BasicResource definition. */ interface Blank extends WithParentResource { } + /** * The stage of the WorkspaceConnectionPropertiesV2BasicResource definition allowing to specify parent resource. */ @@ -78,6 +88,7 @@ interface WithParentResource { */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** The stage of the WorkspaceConnectionPropertiesV2BasicResource definition allowing to specify properties. */ interface WithProperties { /** @@ -88,6 +99,7 @@ interface WithProperties { */ WithCreate withProperties(WorkspaceConnectionPropertiesV2 properties); } + /** * The stage of the WorkspaceConnectionPropertiesV2BasicResource definition which contains all the minimum * required properties for the resource to be created, but also allows for any other optional properties to be @@ -110,6 +122,47 @@ interface WithCreate { WorkspaceConnectionPropertiesV2BasicResource create(Context context); } } + + /** + * Begins update for the WorkspaceConnectionPropertiesV2BasicResource resource. + * + * @return the stage of resource update. + */ + WorkspaceConnectionPropertiesV2BasicResource.Update update(); + + /** The template for WorkspaceConnectionPropertiesV2BasicResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceConnectionPropertiesV2BasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceConnectionPropertiesV2BasicResource apply(Context context); + } + + /** The WorkspaceConnectionPropertiesV2BasicResource update stages. */ + interface UpdateStages { + /** The stage of the WorkspaceConnectionPropertiesV2BasicResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties that the machine learning workspace connection will be + * updated with.. + * + * @param properties The properties that the machine learning workspace connection will be updated with. + * @return the next definition stage. + */ + Update withProperties(WorkspaceConnectionPropertiesV2 properties); + } + } + /** * Refreshes the resource to sync with Azure. * @@ -124,4 +177,24 @@ interface WithCreate { * @return the refreshed resource. */ WorkspaceConnectionPropertiesV2BasicResource refresh(Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listSecretsWithResponse(Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + WorkspaceConnectionPropertiesV2BasicResource listSecrets(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java index 96ab1a4a1025f..fd48674af43c9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java @@ -13,21 +13,41 @@ @Fluent public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { /* - * The value property. + * The nextLink property. */ - @JsonProperty(value = "value") - private List value; + @JsonProperty(value = "nextLink") + private String nextLink; /* - * The nextLink property. + * The value property. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value") + private List value; /** Creates an instance of WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult class. */ public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult() { } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. + */ + public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Get the value property: The value property. * @@ -49,15 +69,6 @@ public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult withValue( return this; } - /** - * Get the nextLink property: The nextLink property. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - /** * Validates the instance. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java new file mode 100644 index 0000000000000..cbb693c4b8ca1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkspaceConnectionServicePrincipal model. */ +@Fluent +public final class WorkspaceConnectionServicePrincipal { + /* + * The clientId property. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The clientSecret property. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * The tenantId property. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** Creates an instance of WorkspaceConnectionServicePrincipal class. */ + public WorkspaceConnectionServicePrincipal() { + } + + /** + * Get the clientId property: The clientId property. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The clientId property. + * + * @param clientId the clientId value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The clientSecret property. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The clientSecret property. + * + * @param clientSecret the clientSecret value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUpdateParameter.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUpdateParameter.java new file mode 100644 index 0000000000000..90d6801fb0d28 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUpdateParameter.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that the machine learning workspace connection will be updated with. */ +@Fluent +public final class WorkspaceConnectionUpdateParameter { + /* + * The properties that the machine learning workspace connection will be updated with. + */ + @JsonProperty(value = "properties") + private WorkspaceConnectionPropertiesV2 properties; + + /** Creates an instance of WorkspaceConnectionUpdateParameter class. */ + public WorkspaceConnectionUpdateParameter() { + } + + /** + * Get the properties property: The properties that the machine learning workspace connection will be updated with. + * + * @return the properties value. + */ + public WorkspaceConnectionPropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: The properties that the machine learning workspace connection will be updated with. + * + * @param properties the properties value to set. + * @return the WorkspaceConnectionUpdateParameter object itself. + */ + public WorkspaceConnectionUpdateParameter withProperties(WorkspaceConnectionPropertiesV2 properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java index 3f8e8255feba9..3a126ff61f214 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java @@ -10,59 +10,59 @@ /** The WorkspaceConnectionUsernamePassword model. */ @Fluent public final class WorkspaceConnectionUsernamePassword { - /* - * The username property. - */ - @JsonProperty(value = "username") - private String username; - /* * The password property. */ @JsonProperty(value = "password") private String password; + /* + * The username property. + */ + @JsonProperty(value = "username") + private String username; + /** Creates an instance of WorkspaceConnectionUsernamePassword class. */ public WorkspaceConnectionUsernamePassword() { } /** - * Get the username property: The username property. + * Get the password property: The password property. * - * @return the username value. + * @return the password value. */ - public String username() { - return this.username; + public String password() { + return this.password; } /** - * Set the username property: The username property. + * Set the password property: The password property. * - * @param username the username value to set. + * @param password the password value to set. * @return the WorkspaceConnectionUsernamePassword object itself. */ - public WorkspaceConnectionUsernamePassword withUsername(String username) { - this.username = username; + public WorkspaceConnectionUsernamePassword withPassword(String password) { + this.password = password; return this; } /** - * Get the password property: The password property. + * Get the username property: The username property. * - * @return the password value. + * @return the username value. */ - public String password() { - return this.password; + public String username() { + return this.username; } /** - * Set the password property: The password property. + * Set the username property: The username property. * - * @param password the password value to set. + * @param username the username value to set. * @return the WorkspaceConnectionUsernamePassword object itself. */ - public WorkspaceConnectionUsernamePassword withPassword(String password) { - this.password = password; + public WorkspaceConnectionUsernamePassword withUsername(String username) { + this.username = username; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java index 2f00285075d10..74c472f8d00a8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java @@ -11,36 +11,35 @@ /** Resource collection API of WorkspaceConnections. */ public interface WorkspaceConnections { /** - * The get operation. + * Lists all the available machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param connectionName Friendly name of the workspace connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + PagedIterable list(String resourceGroupName, String workspaceName); /** - * The get operation. + * Lists all the available machine learning workspaces connections under the specified workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param connectionName Friendly name of the workspace connection. + * @param target Target of the workspace connection. + * @param category Category of the workspace connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the paginated response with {@link PagedIterable}. */ - WorkspaceConnectionPropertiesV2BasicResource get( - String resourceGroupName, String workspaceName, String connectionName); + PagedIterable list( + String resourceGroupName, String workspaceName, String target, String category, Context context); /** - * The delete operation. + * Delete machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -55,7 +54,7 @@ Response deleteWithResponse( String resourceGroupName, String workspaceName, String connectionName, Context context); /** - * The delete operation. + * Delete machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -67,35 +66,65 @@ Response deleteWithResponse( void delete(String resourceGroupName, String workspaceName, String connectionName); /** - * The list operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName); + Response getWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context); /** - * The list operation. + * Lists machine learning workspaces connections by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param target Target of the workspace connection. - * @param category Category of the workspace connection. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + WorkspaceConnectionPropertiesV2BasicResource get( + String resourceGroupName, String workspaceName, String connectionName); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context); + Response listSecretsWithResponse( + String resourceGroupName, String workspaceName, String connectionName, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + WorkspaceConnectionPropertiesV2BasicResource listSecrets( + String resourceGroupName, String workspaceName, String connectionName); /** - * The get operation. + * Lists machine learning workspaces connections by name. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,7 +135,7 @@ PagedIterable list( WorkspaceConnectionPropertiesV2BasicResource getById(String id); /** - * The get operation. + * Lists machine learning workspaces connections by name. * * @param id the resource ID. * @param context The context to associate with this operation. @@ -118,7 +147,7 @@ PagedIterable list( Response getByIdWithResponse(String id, Context context); /** - * The delete operation. + * Delete machine learning workspaces connections by name. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -128,7 +157,7 @@ PagedIterable list( void deleteById(String id); /** - * The delete operation. + * Delete machine learning workspaces connections by name. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java new file mode 100644 index 0000000000000..58df8174002b9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WorkspaceHub's configuration object. */ +@Fluent +public final class WorkspaceHubConfig { + /* + * The additionalWorkspaceStorageAccounts property. + */ + @JsonProperty(value = "additionalWorkspaceStorageAccounts") + private List additionalWorkspaceStorageAccounts; + + /* + * The defaultWorkspaceResourceGroup property. + */ + @JsonProperty(value = "defaultWorkspaceResourceGroup") + private String defaultWorkspaceResourceGroup; + + /** Creates an instance of WorkspaceHubConfig class. */ + public WorkspaceHubConfig() { + } + + /** + * Get the additionalWorkspaceStorageAccounts property: The additionalWorkspaceStorageAccounts property. + * + * @return the additionalWorkspaceStorageAccounts value. + */ + public List additionalWorkspaceStorageAccounts() { + return this.additionalWorkspaceStorageAccounts; + } + + /** + * Set the additionalWorkspaceStorageAccounts property: The additionalWorkspaceStorageAccounts property. + * + * @param additionalWorkspaceStorageAccounts the additionalWorkspaceStorageAccounts value to set. + * @return the WorkspaceHubConfig object itself. + */ + public WorkspaceHubConfig withAdditionalWorkspaceStorageAccounts(List additionalWorkspaceStorageAccounts) { + this.additionalWorkspaceStorageAccounts = additionalWorkspaceStorageAccounts; + return this; + } + + /** + * Get the defaultWorkspaceResourceGroup property: The defaultWorkspaceResourceGroup property. + * + * @return the defaultWorkspaceResourceGroup value. + */ + public String defaultWorkspaceResourceGroup() { + return this.defaultWorkspaceResourceGroup; + } + + /** + * Set the defaultWorkspaceResourceGroup property: The defaultWorkspaceResourceGroup property. + * + * @param defaultWorkspaceResourceGroup the defaultWorkspaceResourceGroup value to set. + * @return the WorkspaceHubConfig object itself. + */ + public WorkspaceHubConfig withDefaultWorkspaceResourceGroup(String defaultWorkspaceResourceGroup) { + this.defaultWorkspaceResourceGroup = defaultWorkspaceResourceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java index 074c218cf7c56..cc6e3a840e441 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java @@ -12,6 +12,12 @@ /** The result of a request to list machine learning workspaces. */ @Fluent public final class WorkspaceListResult { + /* + * The link to the next page constructed using the continuationToken. If null, there are no additional pages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /* * The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to * request the next list of machine learning workspaces. @@ -19,55 +25,51 @@ public final class WorkspaceListResult { @JsonProperty(value = "value") private List value; - /* - * The URI that can be used to request the next list of machine learning workspaces. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - /** Creates an instance of WorkspaceListResult class. */ public WorkspaceListResult() { } /** - * Get the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink - * field should be used to request the next list of machine learning workspaces. + * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Set the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink - * field should be used to request the next list of machine learning workspaces. + * Set the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. * - * @param value the value value to set. + * @param nextLink the nextLink value to set. * @return the WorkspaceListResult object itself. */ - public WorkspaceListResult withValue(List value) { - this.value = value; + public WorkspaceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; return this; } /** - * Get the nextLink property: The URI that can be used to request the next list of machine learning workspaces. + * Get the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink + * field should be used to request the next list of machine learning workspaces. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** - * Set the nextLink property: The URI that can be used to request the next list of machine learning workspaces. + * Set the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink + * field should be used to request the next list of machine learning workspaces. * - * @param nextLink the nextLink value to set. + * @param value the value value to set. * @return the WorkspaceListResult object itself. */ - public WorkspaceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; + public WorkspaceListResult withValue(List value) { + this.value = value; return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePrivateEndpointResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePrivateEndpointResource.java new file mode 100644 index 0000000000000..6b3b65aa75a15 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePrivateEndpointResource.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class WorkspacePrivateEndpointResource { + /* + * e.g. + * /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName} + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The subnetId that the private endpoint is connected to. + */ + @JsonProperty(value = "subnetArmId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetArmId; + + /** Creates an instance of WorkspacePrivateEndpointResource class. */ + public WorkspacePrivateEndpointResource() { + } + + /** + * Get the id property: e.g. + * /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the subnetArmId property: The subnetId that the private endpoint is connected to. + * + * @return the subnetArmId value. + */ + public String subnetArmId() { + return this.subnetArmId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java index 41e6d8c3f5a00..b79af4f634961 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java @@ -10,40 +10,33 @@ /** An immutable client-side representation of WorkspaceProperties. */ public interface WorkspaceProperties { /** - * Gets the workspaceId property: The immutable id associated with this workspace. + * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when + * behind VNet. * - * @return the workspaceId value. + * @return the allowPublicAccessWhenBehindVnet value. */ - String workspaceId(); + Boolean allowPublicAccessWhenBehindVnet(); /** - * Gets the description property: The description of this workspace. + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @return the description value. + * @return the applicationInsights value. */ - String description(); + String applicationInsights(); /** - * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. + * Gets the associatedWorkspaces property: The associatedWorkspaces property. * - * @return the friendlyName value. + * @return the associatedWorkspaces value. */ - String friendlyName(); + List associatedWorkspaces(); /** - * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once - * the workspace has been created. + * Gets the containerRegistries property: The containerRegistries property. * - * @return the keyVault value. + * @return the containerRegistries value. */ - String keyVault(); - - /** - * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @return the applicationInsights value. - */ - String applicationInsights(); + List containerRegistries(); /** * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. @@ -53,12 +46,11 @@ public interface WorkspaceProperties { String containerRegistry(); /** - * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * Gets the description property: The description of this workspace. * - * @return the storageAccount value. + * @return the description value. */ - String storageAccount(); + String description(); /** * Gets the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning @@ -69,20 +61,40 @@ public interface WorkspaceProperties { String discoveryUrl(); /** - * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is - * to indicate states for resource provisioning. + * Gets the enableDataIsolation property: The enableDataIsolation property. * - * @return the provisioningState value. + * @return the enableDataIsolation value. */ - ProvisioningState provisioningState(); + Boolean enableDataIsolation(); /** - * Gets the encryption property: The encryption settings of Azure ML workspace. + * Gets the encryption property: The encryption property. * * @return the encryption value. */ EncryptionProperty encryption(); + /** + * Gets the existingWorkspaces property: The existingWorkspaces property. + * + * @return the existingWorkspaces value. + */ + List existingWorkspaces(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + String friendlyName(); + /** * Gets the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. @@ -92,41 +104,63 @@ public interface WorkspaceProperties { Boolean hbiWorkspace(); /** - * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP - * in customer subscription if the workspace is CMK workspace. + * Gets the hubResourceId property: The hubResourceId property. * - * @return the serviceProvisionedResourceGroup value. + * @return the hubResourceId value. */ - String serviceProvisionedResourceGroup(); + String hubResourceId(); /** - * Gets the privateLinkCount property: Count of private connections in the workspace. + * Gets the imageBuildCompute property: The compute name for image build. * - * @return the privateLinkCount value. + * @return the imageBuildCompute value. */ - Integer privateLinkCount(); + String imageBuildCompute(); /** - * Gets the imageBuildCompute property: The compute name for image build. + * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once + * the workspace has been created. * - * @return the imageBuildCompute value. + * @return the keyVault value. */ - String imageBuildCompute(); + String keyVault(); /** - * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when - * behind VNet. + * Gets the keyVaults property: The keyVaults property. * - * @return the allowPublicAccessWhenBehindVnet value. + * @return the keyVaults value. */ - Boolean allowPublicAccessWhenBehindVnet(); + List keyVaults(); /** - * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @return the publicNetworkAccess value. + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point + * at to set up tracking. + * + * @return the mlFlowTrackingUri value. + */ + String mlFlowTrackingUri(); + + /** + * Gets the notebookInfo property: The notebook info of Azure ML workspace. + * + * @return the notebookInfo value. + */ + NotebookResourceInfo notebookInfo(); + + /** + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. */ - PublicNetworkAccess publicNetworkAccess(); + String primaryUserAssignedIdentity(); /** * Gets the privateEndpointConnections property: The list of private endpoint connections in the workspace. @@ -136,18 +170,26 @@ public interface WorkspaceProperties { List privateEndpointConnections(); /** - * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. + * Gets the privateLinkCount property: Count of private connections in the workspace. * - * @return the sharedPrivateLinkResources value. + * @return the privateLinkCount value. */ - List sharedPrivateLinkResources(); + Integer privateLinkCount(); /** - * Gets the notebookInfo property: The notebook info of Azure ML workspace. + * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is + * to indicate states for resource provisioning. * - * @return the notebookInfo value. + * @return the provisioningState value. */ - NotebookResourceInfo notebookInfo(); + ProvisioningState provisioningState(); + + /** + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessType publicNetworkAccess(); /** * Gets the serviceManagedResourcesSettings property: The service managed resource settings. @@ -157,19 +199,41 @@ public interface WorkspaceProperties { ServiceManagedResourcesSettings serviceManagedResourcesSettings(); /** - * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. + * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP + * in customer subscription if the workspace is CMK workspace. * - * @return the primaryUserAssignedIdentity value. + * @return the serviceProvisionedResourceGroup value. */ - String primaryUserAssignedIdentity(); + String serviceProvisionedResourceGroup(); /** - * Gets the tenantId property: The tenant id associated with this workspace. + * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. * - * @return the tenantId value. + * @return the sharedPrivateLinkResources value. */ - String tenantId(); + List sharedPrivateLinkResources(); + + /** + * Gets the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @return the softDeleteRetentionInDays value. + */ + Integer softDeleteRetentionInDays(); + + /** + * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be + * changed once the workspace has been created. + * + * @return the storageAccount value. + */ + String storageAccount(); + + /** + * Gets the storageAccounts property: The storageAccounts property. + * + * @return the storageAccounts value. + */ + List storageAccounts(); /** * Gets the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS) @@ -180,12 +244,19 @@ public interface WorkspaceProperties { Boolean storageHnsEnabled(); /** - * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point - * at to set up tracking. + * Gets the systemDatastoresAuthMode property: The auth mode used for accessing the system datastores of the + * workspace. * - * @return the mlFlowTrackingUri value. + * @return the systemDatastoresAuthMode value. */ - String mlFlowTrackingUri(); + String systemDatastoresAuthMode(); + + /** + * Gets the tenantId property: The tenant id associated with this workspace. + * + * @return the tenantId value. + */ + String tenantId(); /** * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 @@ -195,6 +266,20 @@ public interface WorkspaceProperties { */ Boolean v1LegacyMode(); + /** + * Gets the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + WorkspaceHubConfig workspaceHubConfig(); + + /** + * Gets the workspaceId property: The immutable id associated with this workspace. + * + * @return the workspaceId value. + */ + String workspaceId(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesInner object. * diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java new file mode 100644 index 0000000000000..039eba5f25a3a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner; + +/** An immutable client-side representation of WorkspacePropertiesUpdateParameters. */ +public interface WorkspacePropertiesUpdateParameters { + /** + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + String applicationInsights(); + + /** + * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + String containerRegistry(); + + /** + * Gets the description property: The description of this workspace. + * + * @return the description value. + */ + String description(); + + /** + * Gets the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + Boolean enableDataIsolation(); + + /** + * Gets the encryption property: The encryption property. + * + * @return the encryption value. + */ + EncryptionUpdateProperties encryption(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + String imageBuildCompute(); + + /** + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + String primaryUserAssignedIdentity(); + + /** + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccessType publicNetworkAccess(); + + /** + * Gets the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + ServiceManagedResourcesSettings serviceManagedResourcesSettings(); + + /** + * Gets the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. + * + * @return the softDeleteRetentionInDays value. + */ + Integer softDeleteRetentionInDays(); + + /** + * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + Boolean v1LegacyMode(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner + * object. + * + * @return the inner object. + */ + WorkspacePropertiesUpdateParametersInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java index 7d7ada04b8eed..d294e846cc516 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java @@ -4,314 +4,137 @@ package com.azure.resourcemanager.machinelearning.models; -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import java.util.Map; -/** The parameters for updating a machine learning workspace. */ -@Fluent -public final class WorkspaceUpdateParameters { - /* - * The resource tags for the machine learning workspace. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The sku of the workspace. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /* - * The properties that the machine learning workspace will be updated with. - */ - @JsonProperty(value = "properties") - private WorkspacePropertiesUpdateParameters innerProperties; - - /** Creates an instance of WorkspaceUpdateParameters class. */ - public WorkspaceUpdateParameters() { - } - - /** - * Get the tags property: The resource tags for the machine learning workspace. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - +/** An immutable client-side representation of WorkspaceUpdateParameters. */ +public interface WorkspaceUpdateParameters { /** - * Set the tags property: The resource tags for the machine learning workspace. + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). * - * @param tags the tags value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the identity value. */ - public WorkspaceUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } + ManagedServiceIdentity identity(); /** - * Get the sku property: The sku of the workspace. + * Gets the sku property: Optional. This field is required to be implemented by the RP because AML is supporting + * more than one tier. * * @return the sku value. */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the workspace. - * - * @param sku the sku value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } + Sku sku(); /** - * Get the identity property: The identity of the resource. + * Gets the tags property: The resource tags for the machine learning workspace. * - * @return the identity value. + * @return the tags value. */ - public ManagedServiceIdentity identity() { - return this.identity; - } + Map tags(); /** - * Set the identity property: The identity of the resource. + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. * - * @param identity the identity value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the applicationInsights value. */ - public WorkspaceUpdateParameters withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } + String applicationInsights(); /** - * Get the innerProperties property: The properties that the machine learning workspace will be updated with. + * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. * - * @return the innerProperties value. + * @return the containerRegistry value. */ - private WorkspacePropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } + String containerRegistry(); /** - * Get the description property: The description of this workspace. + * Gets the description property: The description of this workspace. * * @return the description value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of this workspace. - * - * @param description the description value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withDescription(description); - return this; - } + String description(); /** - * Get the friendlyName property: The friendly name for this workspace. + * Gets the enableDataIsolation property: The enableDataIsolation property. * - * @return the friendlyName value. + * @return the enableDataIsolation value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } + Boolean enableDataIsolation(); /** - * Set the friendlyName property: The friendly name for this workspace. + * Gets the encryption property: The encryption property. * - * @param friendlyName the friendlyName value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the encryption value. */ - public WorkspaceUpdateParameters withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } + EncryptionUpdateProperties encryption(); /** - * Get the imageBuildCompute property: The compute name for image build. + * Gets the featureStoreSettings property: Settings for feature store type workspace. * - * @return the imageBuildCompute value. + * @return the featureStoreSettings value. */ - public String imageBuildCompute() { - return this.innerProperties() == null ? null : this.innerProperties().imageBuildCompute(); - } + FeatureStoreSettings featureStoreSettings(); /** - * Set the imageBuildCompute property: The compute name for image build. + * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. * - * @param imageBuildCompute the imageBuildCompute value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the friendlyName value. */ - public WorkspaceUpdateParameters withImageBuildCompute(String imageBuildCompute) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withImageBuildCompute(imageBuildCompute); - return this; - } + String friendlyName(); /** - * Get the serviceManagedResourcesSettings property: The service managed resource settings. + * Gets the imageBuildCompute property: The compute name for image build. * - * @return the serviceManagedResourcesSettings value. + * @return the imageBuildCompute value. */ - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.innerProperties() == null ? null : this.innerProperties().serviceManagedResourcesSettings(); - } + String imageBuildCompute(); /** - * Set the serviceManagedResourcesSettings property: The service managed resource settings. + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. * - * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the managedNetwork value. */ - public WorkspaceUpdateParameters withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); - return this; - } + ManagedNetworkSettings managedNetwork(); /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the * workspace identity. * * @return the primaryUserAssignedIdentity value. */ - public String primaryUserAssignedIdentity() { - return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); - } - - /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); - return this; - } + String primaryUserAssignedIdentity(); /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. * * @return the publicNetworkAccess value. */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); - } - - /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @return the applicationInsights value. - */ - public String applicationInsights() { - return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); - } + PublicNetworkAccessType publicNetworkAccess(); /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * Gets the serviceManagedResourcesSettings property: The service managed resource settings. * - * @param applicationInsights the applicationInsights value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the serviceManagedResourcesSettings value. */ - public WorkspaceUpdateParameters withApplicationInsights(String applicationInsights) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withApplicationInsights(applicationInsights); - return this; - } + ServiceManagedResourcesSettings serviceManagedResourcesSettings(); /** - * Get the containerRegistry property: ARM id of the container registry associated with this workspace. + * Gets the softDeleteRetentionInDays property: Retention time in days after workspace get soft deleted. * - * @return the containerRegistry value. + * @return the softDeleteRetentionInDays value. */ - public String containerRegistry() { - return this.innerProperties() == null ? null : this.innerProperties().containerRegistry(); - } + Integer softDeleteRetentionInDays(); /** - * Set the containerRegistry property: ARM id of the container registry associated with this workspace. + * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. * - * @param containerRegistry the containerRegistry value to set. - * @return the WorkspaceUpdateParameters object itself. + * @return the v1LegacyMode value. */ - public WorkspaceUpdateParameters withContainerRegistry(String containerRegistry) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withContainerRegistry(containerRegistry); - return this; - } + Boolean v1LegacyMode(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } + WorkspaceUpdateParametersInner innerModel(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java index 3d21925cc55f9..0558d9dfebc54 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java @@ -11,29 +11,55 @@ /** Resource collection API of Workspaces. */ public interface Workspaces { /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the available machine learning workspaces under the specified subscription. + * + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace along with {@link Response}. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); + PagedIterable list(String skip, String kind, Context context); /** - * Gets the properties of the specified machine learning workspace. + * Lists all the available machine learning workspaces under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified machine learning workspace. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. */ - Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the available machine learning workspaces under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skip Continuation token for pagination. + * @param kind Kind of workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list machine learning workspaces as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String skip, String kind, Context context); /** * Deletes a machine learning workspace. @@ -44,45 +70,45 @@ public interface Workspaces { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String workspaceName); + void delete(String resourceGroupName, String workspaceName); /** * Deletes a machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String workspaceName, Context context); + void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context); /** - * Lists all the available machine learning workspaces under the specified resource group. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the properties of the specified machine learning workspace along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * Lists all the available machine learning workspaces under the specified resource group. + * Gets the properties of the specified machine learning workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param skip Continuation token for pagination. - * @param context The context to associate with this operation. + * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the properties of the specified machine learning workspace. */ - PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); + Workspace getByResourceGroup(String resourceGroupName, String workspaceName); /** * Diagnose workspace setup issue. @@ -101,7 +127,7 @@ public interface Workspaces { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param parameters The parameter of diagnosing workspace health. + * @param body The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -109,7 +135,7 @@ public interface Workspaces { * @return the response. */ DiagnoseResponseResult diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context); + String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters body, Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and @@ -140,55 +166,33 @@ Response listKeysWithResponse( ListWorkspaceKeysResult listKeys(String resourceGroupName, String workspaceName); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Machine Learning Workspace notebook access token along with {@link Response}. */ - void resyncKeys(String resourceGroupName, String workspaceName); + Response listNotebookAccessTokenWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and - * password for container registry. + * Get Azure Machine Learning Workspace notebook access token. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Machine Learning Workspace notebook access token. */ - void resyncKeys(String resourceGroupName, String workspaceName, Context context); - - /** - * Lists all the available machine learning workspaces under the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the available machine learning workspaces under the specified subscription. - * - * @param skip Continuation token for pagination. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String skip, Context context); + NotebookAccessTokenResult listNotebookAccessToken(String resourceGroupName, String workspaceName); /** - * return notebook access token and refresh token. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -198,11 +202,11 @@ Response listKeysWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listNotebookAccessTokenWithResponse( + Response listNotebookKeysWithResponse( String resourceGroupName, String workspaceName, Context context); /** - * return notebook access token and refresh token. + * Lists keys of Azure Machine Learning Workspaces notebook. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -211,35 +215,36 @@ Response listNotebookAccessTokenWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - NotebookAccessTokenResult listNotebookAccessToken(String resourceGroupName, String workspaceName); + ListNotebookKeysResult listNotebookKeys(String resourceGroupName, String workspaceName); /** - * Prepare a notebook. + * Lists keys of Azure Machine Learning Workspace's storage account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName); + Response listStorageAccountKeysWithResponse( + String resourceGroupName, String workspaceName, Context context); /** - * Prepare a notebook. + * Lists keys of Azure Machine Learning Workspace's storage account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName, Context context); + ListStorageAccountKeysResult listStorageAccountKeys(String resourceGroupName, String workspaceName); /** - * List storage account keys of a workspace. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -249,11 +254,11 @@ Response listNotebookAccessTokenWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listStorageAccountKeysWithResponse( + Response listOutboundNetworkDependenciesEndpointsWithResponse( String resourceGroupName, String workspaceName, Context context); /** - * List storage account keys of a workspace. + * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. @@ -262,59 +267,57 @@ Response listStorageAccountKeysWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - ListStorageAccountKeysResult listStorageAccountKeys(String resourceGroupName, String workspaceName); + ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String workspaceName); /** - * List keys of a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName); /** - * List keys of a notebook. + * Prepare Azure Machine Learning Workspace's notebook resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - ListNotebookKeysResult listNotebookKeys(String resourceGroupName, String workspaceName); + NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName, Context context); /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. */ - Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context); + void resyncKeys(String resourceGroupName, String workspaceName); /** - * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. + * Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and + * password for container registry. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String workspaceName); + void resyncKeys(String resourceGroupName, String workspaceName, Context context); /** * Gets the properties of the specified machine learning workspace. @@ -353,12 +356,13 @@ Response listOutboundNetworkDependenciesEndpointsWithRespo * Deletes a machine learning workspace. * * @param id the resource ID. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Boolean forceToPurge, Context context); /** * Begins definition for a new Workspace resource. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java index 2577043eada6c..d0923a3048a1a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for AzureMachineLearningWorkspaces. These APIs allow end users to operate on Azure + * Package containing the data models for AzureMachineLearningServices. These APIs allow end users to operate on Azure * Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.models; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java index a318a1e7d76bb..93e6c12b06e6e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for AzureMachineLearningWorkspaces. These APIs allow end users to operate on Azure + * Package containing the classes for AzureMachineLearningServices. These APIs allow end users to operate on Azure * Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java index fb21453d26444..fa9ff97f0e187 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java @@ -26,14 +26,14 @@ /** Samples for BatchDeployments CreateOrUpdate. */ public final class BatchDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Deployment. + * Sample code: CreateOrUpdate Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchDeployment( + public static void createOrUpdateWorkspaceBatchDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { manager .batchDeployments() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java index 7b39c6096d2c9..8684c6a72aa0f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchDeployments Delete. */ public final class BatchDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/delete.json */ /** - * Sample code: Delete Batch Deployment. + * Sample code: Delete Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .delete( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java index c1b47f7e527f9..08f81be47a5a5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchDeployments Get. */ public final class BatchDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/get.json */ /** - * Sample code: Get Batch Deployment. + * Sample code: Get Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .getWithResponse( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java index b5fff0eb963bb..c44ca37de9061 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchDeployments List. */ public final class BatchDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/list.json */ /** - * Sample code: List Batch Deployment. + * Sample code: List Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchDeployments() .list( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java index 847ffdcac6c71..686795e44115a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java @@ -12,14 +12,15 @@ /** Samples for BatchDeployments Update. */ public final class BatchDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchDeployment/update.json */ /** - * Sample code: Update Batch Deployment. + * Sample code: Update Workspace Batch Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void updateWorkspaceBatchDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { BatchDeployment resource = manager .batchDeployments() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java index 456f30a703bec..15ac811043d3a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java @@ -18,14 +18,14 @@ /** Samples for BatchEndpoints CreateOrUpdate. */ public final class BatchEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Endpoint. + * Sample code: CreateOrUpdate Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchEndpoint( + public static void createOrUpdateWorkspaceBatchEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java index 6456c727fcc49..70f46c6d5c171 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchEndpoints Delete. */ public final class BatchEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/delete.json */ /** - * Sample code: Delete Batch Endpoint. + * Sample code: Delete Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .delete("resourceGroup-1234", "testworkspace", "testBatchEndpoint", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java index 9daf7b13cfeef..48348f6bde51d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchEndpoints Get. */ public final class BatchEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/get.json */ /** - * Sample code: Get Batch Endpoint. + * Sample code: Get Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java index 5d0685fd73105..062bef68d7c40 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchEndpoints ListKeys. */ public final class BatchEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/listKeys.json */ /** - * Sample code: ListKeys Batch Endpoint. + * Sample code: ListKeys Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listKeysWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .batchEndpoints() .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java index 6ab315093f3db..4ffb3592fbba1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java @@ -7,14 +7,15 @@ /** Samples for BatchEndpoints List. */ public final class BatchEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/list.json */ /** - * Sample code: List Batch Endpoint. + * Sample code: List Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.batchEndpoints().list("test-rg", "my-aml-workspace", 1, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java index 4a7fd23152fe1..8b6b094b98611 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java @@ -16,15 +16,15 @@ /** Samples for BatchEndpoints Update. */ public final class BatchEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/BatchEndpoint/update.json */ /** - * Sample code: Update Batch Endpoint. + * Sample code: Update Workspace Batch Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { + public static void updateWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { BatchEndpoint resource = manager .batchEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java index 99ad6bdb20be5..57a58d73fd29d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; import java.util.HashMap; import java.util.Map; @@ -11,24 +12,27 @@ /** Samples for CodeContainers CreateOrUpdate. */ public final class CodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Container. + * Sample code: CreateOrUpdate Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeContainer( + public static void createOrUpdateWorkspaceCodeContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new CodeContainerProperties() - .withDescription("string") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + .createOrUpdateWithResponse( + "testrg123", + "testworkspace", + "testContainer", + new CodeContainerInner() + .withProperties( + new CodeContainerProperties() + .withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java index f1db0a949fa49..cf1dd919a8f7b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for CodeContainers Delete. */ public final class CodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/delete.json */ /** - * Sample code: Delete Code Container. + * Sample code: Delete Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java index 8bc80b6fe906a..c2fa8e5d2c8a1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java @@ -7,14 +7,15 @@ /** Samples for CodeContainers Get. */ public final class CodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/get.json */ /** - * Sample code: Get Code Container. + * Sample code: Get Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeContainers() .getWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java index fd3cd97cad525..2846cd2215045 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java @@ -7,14 +7,15 @@ /** Samples for CodeContainers List. */ public final class CodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeContainer/list.json */ /** - * Sample code: List Code Container. + * Sample code: List Workspace Code Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.codeContainers().list("testrg123", "testworkspace", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..b183ddecd2375 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for CodeVersions CreateOrGetStartPendingUpload. */ +public final class CodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .codeVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java index 92534796defae..ebedfa8d5897e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; import java.util.HashMap; import java.util.Map; @@ -11,27 +12,31 @@ /** Samples for CodeVersions CreateOrUpdate. */ public final class CodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Version. + * Sample code: CreateOrUpdate Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeVersion( + public static void createOrUpdateWorkspaceCodeVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() - .define("string") - .withExistingCode("test-rg", "my-aml-workspace", "string") - .withProperties( - new CodeVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withCodeUri("fakeTokenPlaceholder")) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new CodeVersionInner() + .withProperties( + new CodeVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java index d933ba22b21ac..cf9a2bd787732 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for CodeVersions Delete. */ public final class CodeVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/delete.json */ /** - * Sample code: Delete Code Version. + * Sample code: Delete Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java index 61640e5ec45f2..2694f846baaeb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for CodeVersions Get. */ public final class CodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/get.json */ /** - * Sample code: Get Code Version. + * Sample code: Get Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java index 779bbf653004e..ae67107cdaf20 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java @@ -7,16 +7,26 @@ /** Samples for CodeVersions List. */ public final class CodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/CodeVersion/list.json */ /** - * Sample code: List Code Version. + * Sample code: List Workspace Code Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .codeVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java index cef6af5f93a33..0220b16f5491b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -11,25 +12,28 @@ /** Samples for ComponentContainers CreateOrUpdate. */ public final class ComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Container. + * Sample code: CreateOrUpdate Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentContainer( + public static void createOrUpdateWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ComponentContainerProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string"))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + new ComponentContainerInner() + .withProperties( + new ComponentContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java index c6b1f50305847..2ae7dfe1a9b4d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for ComponentContainers Delete. */ public final class ComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/delete.json */ /** - * Sample code: Delete Component Container. + * Sample code: Delete Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentContainer( + public static void deleteWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java index a3370c8ca451a..016e7b8284ed3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java @@ -7,14 +7,15 @@ /** Samples for ComponentContainers Get. */ public final class ComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/get.json */ /** - * Sample code: Get Component Container. + * Sample code: Get Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentContainers() .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java index bd2af0671ad33..b12e2470ca97d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java @@ -7,14 +7,14 @@ /** Samples for ComponentContainers List. */ public final class ComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentContainer/list.json */ /** - * Sample code: List Component Container. + * Sample code: List Workspace Component Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentContainer( + public static void listWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.componentContainers().list("test-rg", "my-aml-workspace", null, null, com.azure.core.util.Context.NONE); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java index dfb4e061dd7d0..c14b718184628 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java @@ -6,6 +6,7 @@ import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; import java.io.IOException; import java.util.HashMap; @@ -14,33 +15,37 @@ /** Samples for ComponentVersions CreateOrUpdate. */ public final class ComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Version. + * Sample code: CreateOrUpdate Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentVersion( + public static void createOrUpdateWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { manager .componentVersions() - .define("string") - .withExistingComponent("test-rg", "my-aml-workspace", "string") - .withProperties( - new ComponentVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withComponentSpec( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", - Object.class, - SerializerEncoding.JSON))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new ComponentVersionInner() + .withProperties( + new ComponentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withComponentSpec( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", + Object.class, + SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java index d20b0d247f326..410acb0c1e9b9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for ComponentVersions Delete. */ public final class ComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/delete.json */ /** - * Sample code: Delete Component Version. + * Sample code: Delete Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentVersion( + public static void deleteWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java index fde41af2e3051..6245f2f541942 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for ComponentVersions Get. */ public final class ComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/get.json */ /** - * Sample code: Get Component Version. + * Sample code: Get Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java index 19a8b1a2ac811..2f7bed5adafcc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java @@ -7,16 +7,26 @@ /** Samples for ComponentVersions List. */ public final class ComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ComponentVersion/list.json */ /** - * Sample code: List Component Version. + * Sample code: List Workspace Component Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .componentVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeAllowedResizeSizesSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeAllowedResizeSizesSamples.java new file mode 100644 index 0000000000000..712b21f177783 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeAllowedResizeSizesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Compute AllowedResizeSizes. */ +public final class ComputeAllowedResizeSizesSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/allowedVMSizesForResize.json + */ + /** + * Sample code: List VM Sizes. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .allowedResizeSizesWithResponse( + "testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java index 943186937135e..5fa6bbbec2c75 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java @@ -12,29 +12,48 @@ import com.azure.resourcemanager.machinelearning.models.AssignedUser; import com.azure.resourcemanager.machinelearning.models.ComputeInstance; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAuthorizationType; +import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAutologgerSettings; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceProperties; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceSshSettings; +import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; +import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; +import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; +import com.azure.resourcemanager.machinelearning.models.Cron; +import com.azure.resourcemanager.machinelearning.models.CustomService; import com.azure.resourcemanager.machinelearning.models.DataFactory; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; import com.azure.resourcemanager.machinelearning.models.Kubernetes; import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; +import com.azure.resourcemanager.machinelearning.models.MlflowAutologger; import com.azure.resourcemanager.machinelearning.models.OsType; import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; +import com.azure.resourcemanager.machinelearning.models.Protocol; import com.azure.resourcemanager.machinelearning.models.RemoteLoginPortPublicAccess; import com.azure.resourcemanager.machinelearning.models.ResourceId; import com.azure.resourcemanager.machinelearning.models.ScaleSettings; +import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; import com.azure.resourcemanager.machinelearning.models.SshPublicAccess; +import com.azure.resourcemanager.machinelearning.models.TriggerType; import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; import com.azure.resourcemanager.machinelearning.models.VmPriority; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; import java.time.Duration; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** Samples for Compute CreateOrUpdate. */ public final class ComputeCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. @@ -52,7 +71,7 @@ public static void createAnAKSCompute(com.azure.resourcemanager.machinelearning. } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. @@ -75,7 +94,7 @@ public static void updateAnAKSCompute(com.azure.resourcemanager.machinelearning. } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/KubernetesCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. @@ -112,7 +131,7 @@ public static void attachAKubernetesCompute( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. @@ -140,12 +159,26 @@ public static void createAnComputeInstanceComputeWithSchedules( .withAssignedUser( new AssignedUser() .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + .withTenantId("00000000-0000-0000-0000-000000000000"))) + .withSchedules( + new ComputeSchedules() + .withComputeStartStop( + Arrays + .asList( + new ComputeStartStopSchedule() + .withStatus(ScheduleStatus.ENABLED) + .withAction(ComputePowerAction.STOP) + .withTriggerType(TriggerType.CRON) + .withCron( + new Cron() + .withStartTime("2021-04-23T01:30:00") + .withTimeZone("Pacific Standard Time") + .withExpression("0 18 * * *"))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. @@ -181,7 +214,7 @@ public static void createAAMLCompute(com.azure.resourcemanager.machinelearning.M } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstance.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. @@ -202,9 +235,49 @@ public static void createAnComputeInstanceCompute( .withVmSize("STANDARD_NC6") .withSubnet(new ResourceId().withId("test-subnet-resource-id")) .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withAutologgerSettings( + new ComputeInstanceAutologgerSettings().withMlflowAutologger(MlflowAutologger.ENABLED)) .withSshSettings( new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withCustomServices( + Arrays + .asList( + new CustomService() + .withName("rstudio-workbench") + .withImage( + new Image() + .withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rstudio-workbench:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables( + mapOf( + "RSP_LICENSE", + new EnvironmentVariable() + .withType(EnvironmentVariableType.LOCAL) + .withValue("XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX") + .withAdditionalProperties(mapOf()))) + .withDocker( + new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints( + Arrays + .asList( + new Endpoint() + .withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(4444))) + .withVolumes( + Arrays + .asList( + new VolumeDefinition() + .withType(VolumeDefinitionType.BIND) + .withReadOnly(true) + .withSource("/mnt/azureuser/") + .withTarget("/home/testuser/"))) + .withAdditionalProperties(mapOf()))) .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withEnableOSPatching(true) + .withReleaseQuotaOnStop(true) .withPersonalComputeInstanceSettings( new PersonalComputeInstanceSettings() .withAssignedUser( @@ -215,7 +288,7 @@ public static void createAnComputeInstanceCompute( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. @@ -235,7 +308,7 @@ public static void createAnComputeInstanceComputeWithMinimalInputs( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. @@ -262,7 +335,7 @@ public static void updateAAMLCompute(com.azure.resourcemanager.machinelearning.M } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json */ /** * Sample code: Create a DataFactory Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java index ee6c38e168ead..afe5803b5670b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Compute Delete. */ public final class ComputeDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/delete.json */ /** * Sample code: Delete Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java index eeb1c6dfefd94..bc63e5bbf0c85 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute Get. */ public final class ComputeGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AKSCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/AKSCompute.json */ /** * Sample code: Get a AKS Compute. @@ -21,7 +21,7 @@ public static void getAAKSCompute(com.azure.resourcemanager.machinelearning.Mach } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/KubernetesCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. @@ -35,7 +35,7 @@ public static void getAKubernetesCompute(com.azure.resourcemanager.machinelearni } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/ComputeInstance.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. @@ -49,7 +49,7 @@ public static void getAnComputeInstance(com.azure.resourcemanager.machinelearnin } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AmlCompute.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/get/AmlCompute.json */ /** * Sample code: Get a AML Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java index 2591bf4e8cf7d..0ceb30d70cee3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute ListKeys. */ public final class ComputeListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/listKeys.json */ /** * Sample code: List AKS Compute Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java index 6a76b986c2c8c..69c8549258340 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute ListNodes. */ public final class ComputeListNodesSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listNodes.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/listNodes.json */ /** * Sample code: Get compute nodes information for a compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java index 76569fd48bfb8..e58e339c624f5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute List. */ public final class ComputeListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/list.json */ /** * Sample code: Get Computes. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeResizeSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeResizeSamples.java new file mode 100644 index 0000000000000..42fd24e019df3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeResizeSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ResizeSchema; + +/** Samples for Compute Resize. */ +public final class ComputeResizeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/resize.json + */ + /** + * Sample code: List VM Sizes. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .resize( + "testrg123", + "workspaces123", + "compute123", + new ResizeSchema().withTargetVMSize("Standard_DS11_v2"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java index f4e3d4904b1ce..7d1dda6ad8727 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute Restart. */ public final class ComputeRestartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/restart.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/restart.json */ /** * Sample code: Restart ComputeInstance Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java index a27b9dd8f911d..b9a6a9cbea4f0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute Start. */ public final class ComputeStartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/start.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/start.json */ /** * Sample code: Start ComputeInstance Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java index 9b9d0be34a8cc..7e2807a097d4f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java @@ -7,7 +7,7 @@ /** Samples for Compute Stop. */ public final class ComputeStopSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/stop.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/stop.json */ /** * Sample code: Stop ComputeInstance Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateCustomServicesSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateCustomServicesSamples.java new file mode 100644 index 0000000000000..26bc49cec480e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateCustomServicesSamples.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.CustomService; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; +import com.azure.resourcemanager.machinelearning.models.Protocol; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Compute UpdateCustomServices. */ +public final class ComputeUpdateCustomServicesSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/updateCustomServices.json + */ + /** + * Sample code: Update Custom Services. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateCustomServices(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .updateCustomServicesWithResponse( + "testrg123", + "workspaces123", + "compute123", + Arrays + .asList( + new CustomService() + .withName("rstudio-workbench") + .withImage( + new Image() + .withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rstudio-workbench:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables( + mapOf( + "RSP_LICENSE", + new EnvironmentVariable() + .withType(EnvironmentVariableType.LOCAL) + .withValue("XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX") + .withAdditionalProperties(mapOf()))) + .withDocker(new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints( + Arrays + .asList( + new Endpoint() + .withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(4444))) + .withVolumes( + Arrays + .asList( + new VolumeDefinition() + .withType(VolumeDefinitionType.BIND) + .withReadOnly(true) + .withSource("/mnt/azureuser/") + .withTarget("/home/testuser/"))) + .withAdditionalProperties(mapOf())), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateIdleShutdownSettingSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateIdleShutdownSettingSamples.java new file mode 100644 index 0000000000000..dc9fc2cd1a142 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateIdleShutdownSettingSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.IdleShutdownSetting; + +/** Samples for Compute UpdateIdleShutdownSetting. */ +public final class ComputeUpdateIdleShutdownSettingSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/updateIdleShutdownSetting.json + */ + /** + * Sample code: Update idle shutdown setting of ComputeInstance. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateIdleShutdownSettingOfComputeInstance( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .computes() + .updateIdleShutdownSettingWithResponse( + "testrg123", + "workspaces123", + "compute123", + new IdleShutdownSetting().withIdleTimeBeforeShutdown("PT120M"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java index 6ae1b51588f65..7e4adb4c0dfb4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for Compute Update. */ public final class ComputeUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/patch.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Compute/patch.json */ /** * Sample code: Update a AmlCompute Compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java index 470d585fbac73..40f9bd394943e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; import com.azure.resourcemanager.machinelearning.models.DataType; import java.util.HashMap; @@ -12,26 +13,29 @@ /** Samples for DataContainers CreateOrUpdate. */ public final class DataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Container. + * Sample code: CreateOrUpdate Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataContainer( + public static void createOrUpdateWorkspaceDataContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataContainers() - .define("datacontainer123") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new DataContainerProperties() - .withDescription("string") - .withProperties(mapOf("properties1", "value1", "properties2", "value2")) - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDataType(DataType.fromString("UriFile"))) - .create(); + .createOrUpdateWithResponse( + "testrg123", + "workspace123", + "datacontainer123", + new DataContainerInner() + .withProperties( + new DataContainerProperties() + .withDescription("string") + .withProperties(mapOf("properties1", "value1", "properties2", "value2")) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withDataType(DataType.fromString("UriFile"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java index 43273b2c9c5bf..90a247cd650ec 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for DataContainers Delete. */ public final class DataContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/delete.json */ /** - * Sample code: Delete Data Container. + * Sample code: Delete Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataContainers() .deleteWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java index 43692b7b234fe..0cc2200c6734c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java @@ -7,14 +7,15 @@ /** Samples for DataContainers Get. */ public final class DataContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/get.json */ /** - * Sample code: Get Data Container. + * Sample code: Get Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataContainers() .getWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java index 497053036fa39..2aea524d11c4f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java @@ -7,14 +7,15 @@ /** Samples for DataContainers List. */ public final class DataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataContainer/list.json */ /** - * Sample code: List Data Container. + * Sample code: List Workspace Data Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.dataContainers().list("testrg123", "workspace123", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java index d90fcdc2db269..a34c7e1ea1f39 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; import java.util.HashMap; import java.util.Map; @@ -11,27 +12,31 @@ /** Samples for DataVersions CreateOrUpdate. */ public final class DataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Version Base. + * Sample code: CreateOrUpdate Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataVersionBase( + public static void createOrUpdateWorkspaceDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() - .define("string") - .withExistingData("test-rg", "my-aml-workspace", "string") - .withProperties( - new UriFileDataVersion() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withDataUri("string")) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new DataVersionBaseInner() + .withProperties( + new UriFileDataVersion() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withDataUri("string")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java index 79c9624287da9..0d6f8cecf8a6f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for DataVersions Delete. */ public final class DataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/delete.json */ /** - * Sample code: Delete Data Version Base. + * Sample code: Delete Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java index c0ed4ee30644a..84f61802f1efe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for DataVersions Get. */ public final class DataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/get.json */ /** - * Sample code: Get Data Version Base. + * Sample code: Get Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void getDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java index 62ce47598970b..77f40df1216d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java @@ -7,14 +7,15 @@ /** Samples for DataVersions List. */ public final class DataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/DataVersionBase/list.json */ /** - * Sample code: List Data Version Base. + * Sample code: List Workspace Data Version Base. * * @param manager Entry point to MachineLearningManager. */ - public static void listDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .dataVersions() .list( @@ -26,6 +27,7 @@ public static void listDataVersionBase(com.azure.resourcemanager.machinelearning null, "string", null, + null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java index 1ec4a1f1c4ea6..2628d79109fdd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java @@ -19,7 +19,7 @@ /** Samples for Datastores CreateOrUpdate. */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen1 w/ ServicePrincipal). @@ -50,7 +50,7 @@ public static void createOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen2 w/ Service Principal). @@ -84,7 +84,7 @@ public static void createOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (AzureBlob w/ AccountKey). @@ -113,7 +113,7 @@ public static void createOrUpdateDatastoreAzureBlobWAccountKey( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure File store w/ AccountKey). diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java index 74ee3e5e79053..0a4718772aa3d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Datastores Delete. */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/delete.json */ /** * Sample code: Delete datastore. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java index 8bd81700eff59..c32f6aa145671 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Datastores Get. */ public final class DatastoresGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/get.json */ /** * Sample code: Get datastore. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java index 6f768bffac33c..5b7b1039f5351 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java @@ -9,7 +9,7 @@ /** Samples for Datastores List. */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/list.json */ /** * Sample code: List datastores. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java index 4e9a8c6857a50..7742fb9f9d592 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java @@ -7,7 +7,7 @@ /** Samples for Datastores ListSecrets. */ public final class DatastoresListSecretsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/listSecrets.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Datastore/listSecrets.json */ /** * Sample code: Get datastore secrets. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java index 09f24071f65e9..18901059adba2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; @@ -11,27 +12,42 @@ /** Samples for EnvironmentContainers CreateOrUpdate. */ public final class EnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Container. + * Sample code: CreateOrUpdate Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentContainer( + public static void createOrUpdateWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() - .define("testEnvironment") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new EnvironmentContainerProperties() - .withDescription("string") + .createOrUpdateWithResponse( + "testrg123", + "testworkspace", + "testEnvironment", + new EnvironmentContainerInner() .withProperties( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) - .withTags( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) - .create(); + new EnvironmentContainerProperties() + .withDescription("string") + .withProperties( + mapOf( + "additionalProp1", + "string", + "additionalProp2", + "string", + "additionalProp3", + "string")) + .withTags( + mapOf( + "additionalProp1", + "string", + "additionalProp2", + "string", + "additionalProp3", + "string"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java index 62f26c6e966f3..f5d02ece97768 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for EnvironmentContainers Delete. */ public final class EnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Environment Container. + * Sample code: Delete Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentContainer( + public static void deleteWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java index 4fa48edf026f5..3e441750d0f00 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java @@ -7,14 +7,14 @@ /** Samples for EnvironmentContainers Get. */ public final class EnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/get.json */ /** - * Sample code: Get Environment Container. + * Sample code: Get Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentContainer( + public static void getWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java index 85a7bf57bd459..843d3e2a9cfbe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java @@ -7,14 +7,14 @@ /** Samples for EnvironmentContainers List. */ public final class EnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentContainer/list.json */ /** - * Sample code: List Environment Container. + * Sample code: List Workspace Environment Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentContainer( + public static void listWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentContainers() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java index a8c7e309af906..094843197327e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; import com.azure.resourcemanager.machinelearning.models.BuildContext; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; @@ -14,38 +15,42 @@ /** Samples for EnvironmentVersions CreateOrUpdate. */ public final class EnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Version. + * Sample code: CreateOrUpdate Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentVersion( + public static void createOrUpdateWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() - .define("string") - .withExistingEnvironment("test-rg", "my-aml-workspace", "string") - .withProperties( - new EnvironmentVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withBuild( - new BuildContext() - .withContextUri( - "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") - .withDockerfilePath("prod/Dockerfile")) - .withCondaFile("string") - .withImage("docker.io/tensorflow/serving:latest") - .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("string").withPort(1)) - .withReadinessRoute(new Route().withPath("string").withPort(1)) - .withScoringRoute(new Route().withPath("string").withPort(1)))) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new EnvironmentVersionInner() + .withProperties( + new EnvironmentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild( + new BuildContext() + .withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties() + .withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java index 972e72140e300..c7ad9e079ef21 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for EnvironmentVersions Delete. */ public final class EnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/delete.json */ /** - * Sample code: Delete Environment Version. + * Sample code: Delete Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentVersion( + public static void deleteWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java index 04673d4e041d6..c7463e339b387 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for EnvironmentVersions Get. */ public final class EnvironmentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/get.json */ /** - * Sample code: Get Environment Version. + * Sample code: Get Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java index 9aa3338d518f8..d03aa2b8f2616 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java @@ -7,17 +7,26 @@ /** Samples for EnvironmentVersions List. */ public final class EnvironmentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/EnvironmentVersion/list.json */ /** - * Sample code: List Environment Version. + * Sample code: List Workspace Environment Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentVersion( + public static void listWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .environmentVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java new file mode 100644 index 0000000000000..3c0d5f901cd0a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Features Get. */ +public final class FeaturesGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Feature/get.json + */ + /** + * Sample code: Get Feature. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .features() + .getWithResponse( + "test-rg", "my-aml-workspace", "string", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java new file mode 100644 index 0000000000000..d50bfb4ebad4a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Features List. */ +public final class FeaturesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Feature/list.json + */ + /** + * Sample code: List Feature. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .features() + .list( + "test-rg", + "my-aml-workspace", + "string", + "string", + null, + "string", + "string", + "string", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d627e4495baf3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturesetContainers CreateOrUpdate. */ +public final class FeaturesetContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new FeaturesetContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java new file mode 100644 index 0000000000000..95b9109dd79dc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturesetContainers Delete. */ +public final class FeaturesetContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java new file mode 100644 index 0000000000000..1a3ffee34d66c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturesetContainers GetEntity. */ +public final class FeaturesetContainersGetEntitySamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java new file mode 100644 index 0000000000000..1e14749daad9b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturesetContainers List. */ +public final class FeaturesetContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetContainer/list.json + */ + /** + * Sample code: List Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetContainers() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + ListViewType.ARCHIVED_ONLY, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java new file mode 100644 index 0000000000000..7f058e2fd8333 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturesetVersions Backfill. */ +public final class FeaturesetVersionsBackfillSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/backfill.json + */ + /** + * Sample code: Backfill Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void backfillWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .backfill( + "test-rg", + "my-aml-workspace", + "string", + "string", + new FeaturesetVersionBackfillRequest() + .withDescription("string") + .withDisplayName("string") + .withFeatureWindow( + new FeatureWindow() + .withFeatureWindowEnd(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51")) + .withFeatureWindowStart(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSparkConfiguration(mapOf("string", "string")) + .withTags(mapOf("string", "string")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..07bb0b14621a7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; +import com.azure.resourcemanager.machinelearning.models.FeaturesetSpecification; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import com.azure.resourcemanager.machinelearning.models.MaterializationSettings; +import com.azure.resourcemanager.machinelearning.models.MaterializationStoreType; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; +import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; +import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; +import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; +import com.azure.resourcemanager.machinelearning.models.WeekDay; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturesetVersions CreateOrUpdate. */ +public final class FeaturesetVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .define("string") + .withExistingFeatureset("test-rg", "my-aml-workspace", "string") + .withProperties( + new FeaturesetVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withEntities(Arrays.asList("string")) + .withMaterializationSettings( + new MaterializationSettings() + .withNotification( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_FAILED)) + .withEmails(Arrays.asList("string"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSchedule( + new RecurrenceTrigger() + .withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withFrequency(RecurrenceFrequency.DAY) + .withInterval(1) + .withSchedule( + new RecurrenceSchedule() + .withHours(Arrays.asList(1)) + .withMinutes(Arrays.asList(1)) + .withMonthDays(Arrays.asList(1)) + .withWeekDays(Arrays.asList(WeekDay.MONDAY)))) + .withSparkConfiguration(mapOf("string", "string")) + .withStoreType(MaterializationStoreType.ONLINE)) + .withSpecification(new FeaturesetSpecification().withPath("string")) + .withStage("string")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java new file mode 100644 index 0000000000000..8e2614d4b1593 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturesetVersions Delete. */ +public final class FeaturesetVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java new file mode 100644 index 0000000000000..579f802f35566 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturesetVersions Get. */ +public final class FeaturesetVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/get.json + */ + /** + * Sample code: Get Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListMaterializationJobsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListMaterializationJobsSamples.java new file mode 100644 index 0000000000000..c8b1b8ac8e56e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListMaterializationJobsSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturesetVersions ListMaterializationJobs. */ +public final class FeaturesetVersionsListMaterializationJobsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/listMaterializationJobs.json + */ + /** + * Sample code: ListMaterializationJobs Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listMaterializationJobsWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .listMaterializationJobs( + "test-rg", + "my-aml-workspace", + "string", + "string", + null, + "string", + "string", + "string", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java new file mode 100644 index 0000000000000..cc21b96387dba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturesetVersions List. */ +public final class FeaturesetVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturesetVersion/list.json + */ + /** + * Sample code: List Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featuresetVersions() + .list( + "test-rg", + "my-aml-workspace", + "string", + null, + "string", + ListViewType.ALL, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7e4e3eefb4a69 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturestoreEntityContainers CreateOrUpdate. */ +public final class FeaturestoreEntityContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties( + new FeaturestoreEntityContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java new file mode 100644 index 0000000000000..433af44f8619a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturestoreEntityContainers Delete. */ +public final class FeaturestoreEntityContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java new file mode 100644 index 0000000000000..644c6791b4c4b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturestoreEntityContainers GetEntity. */ +public final class FeaturestoreEntityContainersGetEntitySamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java new file mode 100644 index 0000000000000..972eaff0f9b59 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturestoreEntityContainers List. */ +public final class FeaturestoreEntityContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityContainers() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + ListViewType.ALL, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5741dbe20d446 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeatureDataType; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import com.azure.resourcemanager.machinelearning.models.IndexColumn; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FeaturestoreEntityVersions CreateOrUpdate. */ +public final class FeaturestoreEntityVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .define("string") + .withExistingFeaturestoreEntity("test-rg", "my-aml-workspace", "string") + .withProperties( + new FeaturestoreEntityVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withIndexColumns( + Arrays + .asList(new IndexColumn().withColumnName("string").withDataType(FeatureDataType.DATETIME)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java new file mode 100644 index 0000000000000..c7ab5131e380d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturestoreEntityVersions Delete. */ +public final class FeaturestoreEntityVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java new file mode 100644 index 0000000000000..25b145c682f38 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for FeaturestoreEntityVersions Get. */ +public final class FeaturestoreEntityVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + */ + /** + * Sample code: Get Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java new file mode 100644 index 0000000000000..5bb8a49b6213a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for FeaturestoreEntityVersions List. */ +public final class FeaturestoreEntityVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .featurestoreEntityVersions() + .list( + "test-rg", + "my-aml-workspace", + "string", + null, + "string", + ListViewType.ACTIVE_ONLY, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java index 3022117eaeaa9..3bae09a513433 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java @@ -7,7 +7,7 @@ /** Samples for Jobs Cancel. */ public final class JobsCancelSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/cancel.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/cancel.json */ /** * Sample code: Cancel Job. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java index 394e954bdf1d0..b98276498563f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java @@ -6,29 +6,22 @@ import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.AllNodes; import com.azure.resourcemanager.machinelearning.models.AmlToken; -import com.azure.resourcemanager.machinelearning.models.AutoMLJob; +import com.azure.resourcemanager.machinelearning.models.AutologgerSettings; import com.azure.resourcemanager.machinelearning.models.CommandJob; import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; -import com.azure.resourcemanager.machinelearning.models.Goal; -import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.ImageClassification; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; import com.azure.resourcemanager.machinelearning.models.JobService; +import com.azure.resourcemanager.machinelearning.models.JobTier; import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; -import com.azure.resourcemanager.machinelearning.models.Mpi; -import com.azure.resourcemanager.machinelearning.models.Objective; +import com.azure.resourcemanager.machinelearning.models.MLFlowAutologgerState; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; import com.azure.resourcemanager.machinelearning.models.PipelineJob; -import com.azure.resourcemanager.machinelearning.models.SweepJob; -import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; +import com.azure.resourcemanager.machinelearning.models.QueueSettings; import com.azure.resourcemanager.machinelearning.models.TensorFlow; -import com.azure.resourcemanager.machinelearning.models.TrialComponent; import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; import java.io.IOException; import java.time.Duration; @@ -39,7 +32,7 @@ /** Samples for Jobs CreateOrUpdate. */ public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate AutoML Job. @@ -53,61 +46,69 @@ public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelear .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") .withProperties( - new AutoMLJob() + new CommandJob() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) + .withComponentId("string") .withComputeId("string") .withDisplayName("string") .withExperimentName("string") .withIdentity(new AmlToken()) .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_COMPLETED)) + .withEmails(Arrays.asList("string"))) .withServices( mapOf( "string", new JobService() .withEndpoint("string") .withJobServiceType("string") + .withNodes(new AllNodes()) .withPort(1) .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) .withEnvironmentId("string") .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) .withOutputs( mapOf( "string", new UriFileJobOutput() .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.DIRECT) .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.PREMIUM).withPriority(1)) .withResources( new JobResourceConfiguration() .withInstanceCount(1) .withInstanceType("string") + .withLocations(Arrays.asList("string")) .withProperties( mapOf( "string", SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize( - "{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", + "{\"f69c8d5a-9b39-4183-92d3-a2b18944cf95\":null}", Object.class, - SerializerEncoding.JSON)))) - .withTaskDetails( - new ImageClassification() - .withTargetColumnName("string") - .withTrainingData(new MLTableJobInput().withUri("string")) - .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withValidationCropSize("choice(2, 360)"))) - .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Sweep Job. @@ -121,58 +122,69 @@ public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearn .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") .withProperties( - new SweepJob() + new CommandJob() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) + .withComponentId("string") .withComputeId("string") .withDisplayName("string") .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_COMPLETED)) + .withEmails(Arrays.asList("string"))) .withServices( mapOf( "string", new JobService() .withEndpoint("string") .withJobServiceType("string") + .withNodes(new AllNodes()) .withPort(1) .withProperties(mapOf("string", "string")))) - .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) - .withLimits( - new SweepJobLimits() - .withMaxConcurrentTrials(1) - .withMaxTotalTrials(1) - .withTrialTimeout(Duration.parse("PT1S"))) - .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) - .withSamplingAlgorithm(new GridSamplingAlgorithm()) - .withSearchSpace( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) - .withTrial( - new TrialComponent() - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new Mpi().withProcessCountPerInstance(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON)))))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs( + mapOf( + "string", + new UriFileJobOutput() + .withDescription("string") + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.BASIC).withPriority(1)) + .withResources( + new JobResourceConfiguration() + .withInstanceCount(1) + .withInstanceType("string") + .withLocations(Arrays.asList("string")) + .withProperties( + mapOf( + "string", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"5fc1f627-491e-45a0-a6a2-f5b4be884911\":null}", + Object.class, + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Pipeline Job. @@ -217,7 +229,7 @@ public static void createOrUpdatePipelineJob( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Command Job. @@ -235,18 +247,27 @@ public static void createOrUpdateCommandJob( .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) + .withComponentId("string") .withComputeId("string") .withDisplayName("string") .withExperimentName("string") .withIdentity(new AmlToken()) + .withIsArchived(false) + .withNotificationSetting( + new NotificationSetting() + .withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_CANCELLED)) + .withEmails(Arrays.asList("string"))) .withServices( mapOf( "string", new JobService() .withEndpoint("string") .withJobServiceType("string") + .withNodes(new AllNodes()) .withPort(1) .withProperties(mapOf("string", "string")))) + .withAutologgerSettings( + new AutologgerSettings().withMlflowAutologger(MLFlowAutologgerState.DISABLED)) .withCodeId("fakeTokenPlaceholder") .withCommand("string") .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) @@ -259,21 +280,27 @@ public static void createOrUpdateCommandJob( "string", new UriFileJobOutput() .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withAssetName("string") + .withAssetVersion("string") + .withMode(OutputDeliveryMode.UPLOAD) .withUri("string"))) + .withQueueSettings(new QueueSettings().withJobTier(JobTier.BASIC).withPriority(1)) .withResources( new JobResourceConfiguration() .withInstanceCount(1) .withInstanceType("string") + .withLocations(Arrays.asList("string")) .withProperties( mapOf( "string", SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", + "{\"c9ac10d0-915b-4de5-afe8-a4c78a37a558\":null}", Object.class, - SerializerEncoding.JSON))))) + SerializerEncoding.JSON))) + .withDockerArgs("string") + .withShmSize("2g"))) .create(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java index 8634125dda6dd..adb20cdb7f272 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Jobs Delete. */ public final class JobsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/delete.json */ /** * Sample code: Delete Job. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java index de450689ce60a..dc425ad4f37cd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Jobs Get. */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/get.json */ /** * Sample code: Get Command Job. @@ -19,7 +19,7 @@ public static void getCommandJob(com.azure.resourcemanager.machinelearning.Machi } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/get.json */ /** * Sample code: Get AutoML Job. @@ -31,7 +31,7 @@ public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.Machin } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/get.json */ /** * Sample code: Get Sweep Job. @@ -43,7 +43,7 @@ public static void getSweepJob(com.azure.resourcemanager.machinelearning.Machine } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/get.json */ /** * Sample code: Get Pipeline Job. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java index a5e1fdc1b6c31..6516711ea21bb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + /** Samples for Jobs List. */ public final class JobsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/CommandJob/list.json */ /** * Sample code: List Command Job. @@ -17,11 +19,21 @@ public final class JobsListSamples { public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ACTIVE_ONLY, + "string", + false, + "string", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/PipelineJob/list.json */ /** * Sample code: List Pipeline Job. @@ -31,11 +43,21 @@ public static void listCommandJob(com.azure.resourcemanager.machinelearning.Mach public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/SweepJob/list.json */ /** * Sample code: List Sweep Job. @@ -45,11 +67,21 @@ public static void listPipelineJob(com.azure.resourcemanager.machinelearning.Mac public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ACTIVE_ONLY, + "string", + false, + "string", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/AutoMLJob/list.json */ /** * Sample code: List AutoML Job. @@ -57,6 +89,18 @@ public static void listSweepJob(com.azure.resourcemanager.machinelearning.Machin * @param manager Entry point to MachineLearningManager. */ public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, com.azure.core.util.Context.NONE); + manager + .jobs() + .list( + "test-rg", + "my-aml-workspace", + null, + "string", + "string", + ListViewType.ALL, + "string", + false, + "string", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsUpdateSamples.java new file mode 100644 index 0000000000000..1f52d851276fb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.AzureDevOpsWebhook; +import com.azure.resourcemanager.machinelearning.models.JobBase; +import com.azure.resourcemanager.machinelearning.models.PartialJobBase; +import com.azure.resourcemanager.machinelearning.models.PartialNotificationSetting; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Job/update.json + */ + /** + * Sample code: Update Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + JobBase resource = + manager + .jobs() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new PartialJobBase() + .withNotificationSetting( + new PartialNotificationSetting() + .withWebhooks(mapOf("string", new AzureDevOpsWebhook().withEventType("string"))))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e65a45f22ac0f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsCreateOrUpdateSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.LabelCategory; +import com.azure.resourcemanager.machinelearning.models.LabelClass; +import com.azure.resourcemanager.machinelearning.models.LabelingJobImageProperties; +import com.azure.resourcemanager.machinelearning.models.LabelingJobInstructions; +import com.azure.resourcemanager.machinelearning.models.LabelingJobProperties; +import com.azure.resourcemanager.machinelearning.models.MLAssistConfigurationEnabled; +import com.azure.resourcemanager.machinelearning.models.MultiSelect; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LabelingJobs CreateOrUpdate. */ +public final class LabelingJobsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateLabelingJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .define("testLabelingJob") + .withExistingWorkspace("workspace-1234", "testworkspace") + .withProperties( + new LabelingJobProperties() + .withDescription("string") + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withJobInstructions(new LabelingJobInstructions().withUri("link/to/instructions")) + .withLabelCategories( + mapOf( + "myCategory1", + new LabelCategory() + .withClasses( + mapOf( + "myLabelClass1", + new LabelClass().withDisplayName("myLabelClass1").withSubclasses(mapOf()), + "myLabelClass2", + new LabelClass().withDisplayName("myLabelClass2").withSubclasses(mapOf()))) + .withDisplayName("myCategory1Title") + .withMultiSelect(MultiSelect.DISABLED), + "myCategory2", + new LabelCategory() + .withClasses( + mapOf( + "myLabelClass1", + new LabelClass().withDisplayName("myLabelClass1").withSubclasses(mapOf()), + "myLabelClass2", + new LabelClass().withDisplayName("myLabelClass2").withSubclasses(mapOf()))) + .withDisplayName("myCategory2Title") + .withMultiSelect(MultiSelect.DISABLED))) + .withLabelingJobMediaProperties(new LabelingJobImageProperties()) + .withMlAssistConfiguration( + new MLAssistConfigurationEnabled() + .withInferencingComputeBinding( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute") + .withTrainingComputeBinding( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsDeleteSamples.java new file mode 100644 index 0000000000000..60d4c938f9178 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for LabelingJobs Delete. */ +public final class LabelingJobsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/delete.json + */ + /** + * Sample code: Delete Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .deleteWithResponse("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsExportLabelsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsExportLabelsSamples.java new file mode 100644 index 0000000000000..217907d8fe399 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsExportLabelsSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DatasetExportSummary; + +/** Samples for LabelingJobs ExportLabels. */ +public final class LabelingJobsExportLabelsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/exportLabels.json + */ + /** + * Sample code: ExportLabels Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void exportLabelsLabelingJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .exportLabels( + "workspace-1234", + "testworkspace", + "testLabelingJob", + new DatasetExportSummary(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsGetSamples.java new file mode 100644 index 0000000000000..33dc93c620748 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for LabelingJobs Get. */ +public final class LabelingJobsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/get.json + */ + /** + * Sample code: Get Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .getWithResponse( + "workspace-1234", "testworkspace", "testLabelingJob", true, true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsListSamples.java new file mode 100644 index 0000000000000..55d39659c29e5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for LabelingJobs List. */ +public final class LabelingJobsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/list.json + */ + /** + * Sample code: List Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.labelingJobs().list("workspace-1234", "testworkspace", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsPauseSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsPauseSamples.java new file mode 100644 index 0000000000000..274ee4708570f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsPauseSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for LabelingJobs Pause. */ +public final class LabelingJobsPauseSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/pause.json + */ + /** + * Sample code: Pause Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void pauseLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .pauseWithResponse("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsResumeSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsResumeSamples.java new file mode 100644 index 0000000000000..26f246c08ce0d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/LabelingJobsResumeSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for LabelingJobs Resume. */ +public final class LabelingJobsResumeSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/LabelingJob/resume.json + */ + /** + * Sample code: Resume Labeling Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void resumeLabelingJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .labelingJobs() + .resume("workspace-1234", "testworkspace", "testLabelingJob", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java new file mode 100644 index 0000000000000..76863041ebf82 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** Samples for ManagedNetworkProvisions ProvisionManagedNetwork. */ +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/provision.json + */ + /** + * Sample code: Provision ManagedNetwork. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void provisionManagedNetwork( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkProvisions() + .provisionManagedNetwork( + "test-rg", + "aml-workspace-name", + new ManagedNetworkProvisionOptions().withIncludeSpark(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..be1e36eea9350 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FqdnOutboundRule; +import com.azure.resourcemanager.machinelearning.models.RuleCategory; +import com.azure.resourcemanager.machinelearning.models.RuleStatus; + +/** Samples for ManagedNetworkSettingsRule CreateOrUpdate. */ +public final class ManagedNetworkSettingsRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + */ + /** + * Sample code: CreateOrUpdate ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .define("some_string") + .withExistingWorkspace("test-rg", "aml-workspace-name") + .withProperties( + new FqdnOutboundRule() + .withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("some_string")) + .create(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java new file mode 100644 index 0000000000000..8ceace8bfdd07 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for ManagedNetworkSettingsRule Delete. */ +public final class ManagedNetworkSettingsRuleDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/deleteRule.json + */ + /** + * Sample code: Delete ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .delete("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java new file mode 100644 index 0000000000000..b744b88479f2b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for ManagedNetworkSettingsRule Get. */ +public final class ManagedNetworkSettingsRuleGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/getRule.json + */ + /** + * Sample code: Get ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .managedNetworkSettingsRules() + .getWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java new file mode 100644 index 0000000000000..8f5f8be740af5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for ManagedNetworkSettingsRule List. */ +public final class ManagedNetworkSettingsRuleListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ManagedNetwork/listRule.json + */ + /** + * Sample code: List ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules().list("test-rg", "aml-workspace-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java index 677398e18bd28..4c948f17c6ae1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; import java.util.HashMap; import java.util.Map; @@ -11,24 +12,27 @@ /** Samples for ModelContainers CreateOrUpdate. */ public final class ModelContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Container. + * Sample code: CreateOrUpdate Workspace Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelContainer( + public static void createOrUpdateWorkspaceModelContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new ModelContainerProperties() - .withDescription("Model container description") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + .createOrUpdateWithResponse( + "testrg123", + "workspace123", + "testContainer", + new ModelContainerInner() + .withProperties( + new ModelContainerProperties() + .withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java index 886e7ad2633df..07f5d8ee24fbd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelContainers Delete. */ public final class ModelContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/delete.json */ /** - * Sample code: Delete Model Container. + * Sample code: Delete Workspace Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelContainers() .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java index d673453574060..f1a0dc2ef7055 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelContainers Get. */ public final class ModelContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/get.json */ /** - * Sample code: Get Model Container. + * Sample code: Get Workspace Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void getModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelContainers() .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java index c093dc594bcbb..22ba89e6d73b0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelContainers List. */ public final class ModelContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelContainer/list.json */ /** - * Sample code: List Model Container. + * Sample code: List Workspace Model Container. * * @param manager Entry point to MachineLearningManager. */ - public static void listModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java index 878dfda340fdb..d200dc3d38e3b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; import com.azure.resourcemanager.machinelearning.models.FlavorData; import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; import java.util.HashMap; @@ -12,29 +13,33 @@ /** Samples for ModelVersions CreateOrUpdate. */ public final class ModelVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Version. + * Sample code: CreateOrUpdate Workspace Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelVersion( + public static void createOrUpdateWorkspaceModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelVersions() - .define("string") - .withExistingModel("test-rg", "my-aml-workspace", "string") - .withProperties( - new ModelVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) - .withModelType("CustomModel") - .withModelUri("string")) - .create(); + .createOrUpdateWithResponse( + "test-rg", + "my-aml-workspace", + "string", + "string", + new ModelVersionInner() + .withProperties( + new ModelVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java index a47b4bf440298..c6861d98afdb5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelVersions Delete. */ public final class ModelVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/delete.json */ /** - * Sample code: Delete Model Version. + * Sample code: Delete Workspace Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java index 6b3472f7fce9e..3c7622f1f5407 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelVersions Get. */ public final class ModelVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/get.json */ /** - * Sample code: Get Model Version. + * Sample code: Get Workspace Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void getModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java index f5dffaa0e7938..dd5f433e0917b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java @@ -7,14 +7,15 @@ /** Samples for ModelVersions List. */ public final class ModelVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/list.json */ /** - * Sample code: List Model Version. + * Sample code: List Workspace Model Version. * * @param manager Entry point to MachineLearningManager. */ - public static void listModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .modelVersions() .list( @@ -31,6 +32,7 @@ public static void listModelVersion(com.azure.resourcemanager.machinelearning.Ma "string", null, null, + null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPackageMethodSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPackageMethodSamples.java new file mode 100644 index 0000000000000..4f7d23b369b32 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPackageMethodSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.AzureMLBatchInferencingServer; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentId; +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageInputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PackageInputPathUrl; +import com.azure.resourcemanager.machinelearning.models.PackageInputType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ModelVersions PackageMethod. */ +public final class ModelVersionsPackageMethodSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/ModelVersion/package.json + */ + /** + * Sample code: Package Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void packageWorkspaceModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .modelVersions() + .packageMethod( + "test-rg", + "my-aml-workspace", + "string", + "string", + new PackageRequest() + .withBaseEnvironmentSource(new BaseEnvironmentId().withResourceId("string")) + .withEnvironmentVariables(mapOf("string", "string")) + .withInferencingServer( + new AzureMLBatchInferencingServer() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string"))) + .withInputs( + Arrays + .asList( + new ModelPackageInput() + .withInputType(PackageInputType.URI_FILE) + .withMode(PackageInputDeliveryMode.DOWNLOAD) + .withMountPath("string") + .withPath(new PackageInputPathUrl().withUrl("string")))) + .withModelConfiguration( + new ModelConfiguration() + .withMode(PackageInputDeliveryMode.fromString("ReadOnlyMount")) + .withMountPath("string")) + .withTags(mapOf("string", "string")) + .withTargetEnvironmentId("string"), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java index 3043d9ccc18f4..e0e955d9888c5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java @@ -24,7 +24,7 @@ /** Samples for OnlineDeployments CreateOrUpdate. */ public final class OnlineDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Kubernetes Online Deployment. @@ -89,7 +89,7 @@ public static void createOrUpdateKubernetesOnlineDeployment( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Managed Online Deployment. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java index b55caae866863..4040b745a9c4b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for OnlineDeployments Delete. */ public final class OnlineDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineDeployment/delete.json */ /** - * Sample code: Delete Online Deployment. + * Sample code: Delete Workspace Online Deployment. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineDeployment( + public static void deleteWorkspaceOnlineDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineDeployments() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java index 52bb9772696f9..8ead58a36f6dc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java @@ -10,7 +10,7 @@ /** Samples for OnlineDeployments GetLogs. */ public final class OnlineDeploymentsGetLogsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/getLogs.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/getLogs.json */ /** * Sample code: Get Online Deployment Logs. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java index 1f3ce3be094ee..1782427010035 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for OnlineDeployments Get. */ public final class OnlineDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json */ /** * Sample code: Get Kubernetes Online Deployment. @@ -27,7 +27,7 @@ public static void getKubernetesOnlineDeployment( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json */ /** * Sample code: Get Managed Online Deployment. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java index 10373db08f210..54165ddf6e74c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java @@ -7,7 +7,7 @@ /** Samples for OnlineDeployments List. */ public final class OnlineDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/list.json */ /** * Sample code: List Online Deployments. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java index bf08722862482..1eb8a86aab87d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java @@ -7,7 +7,7 @@ /** Samples for OnlineDeployments ListSkus. */ public final class OnlineDeploymentsListSkusSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json */ /** * Sample code: List Managed Online Deployment Skus. @@ -29,7 +29,7 @@ public static void listManagedOnlineDeploymentSkus( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json */ /** * Sample code: List Kubernetes Online Deployment Skus. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java index 45cf7405cce15..f5ce970c56c74 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for OnlineDeployments Update. */ public final class OnlineDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json */ /** * Sample code: Update Managed Online Deployment. @@ -46,7 +46,7 @@ public static void updateManagedOnlineDeployment( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json */ /** * Sample code: Update Kubernetes Online Deployment. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java index c5a7830b8a283..4f2d2903e0421 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java @@ -17,14 +17,14 @@ /** Samples for OnlineEndpoints CreateOrUpdate. */ public final class OnlineEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Online Endpoint. + * Sample code: CreateOrUpdate Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateOnlineEndpoint( + public static void createOrUpdateWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java index e5728f1084b12..d3d6dc88fce02 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java @@ -7,14 +7,15 @@ /** Samples for OnlineEndpoints Delete. */ public final class OnlineEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/delete.json */ /** - * Sample code: Delete Online Endpoint. + * Sample code: Delete Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void deleteWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java index 7bb869bf92cb4..a524a4a5c22b0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java @@ -7,14 +7,15 @@ /** Samples for OnlineEndpoints Get. */ public final class OnlineEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/get.json */ /** - * Sample code: Get Online Endpoint. + * Sample code: Get Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void getWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java index 0bddb517bc738..fb0bfc5725446 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java @@ -7,14 +7,14 @@ /** Samples for OnlineEndpoints GetToken. */ public final class OnlineEndpointsGetTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/getToken.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/getToken.json */ /** - * Sample code: GetToken Online Endpoint. + * Sample code: GetToken Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void getTokenOnlineEndpoint( + public static void getTokenWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java index 6ec08e5fd2fd7..a1248e3a7f5c7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java @@ -7,14 +7,14 @@ /** Samples for OnlineEndpoints ListKeys. */ public final class OnlineEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json */ /** - * Sample code: ListKeys Online Endpoint. + * Sample code: ListKeys Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysOnlineEndpoint( + public static void listKeysWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java index 93ac7f0262cd3..00215519d44aa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java @@ -10,14 +10,15 @@ /** Samples for OnlineEndpoints List. */ public final class OnlineEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/list.json */ /** - * Sample code: List Online Endpoint. + * Sample code: List Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void listWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() .list( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java index 9055f46d6d28c..c5d0b59352178 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java @@ -10,14 +10,14 @@ /** Samples for OnlineEndpoints RegenerateKeys. */ public final class OnlineEndpointsRegenerateKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/regenerateKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json */ /** - * Sample code: RegenerateKeys Online Endpoint. + * Sample code: RegenerateKeys Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void regenerateKeysOnlineEndpoint( + public static void regenerateKeysWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .onlineEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java index 617aea5a21ebb..73b2e2e71800d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java @@ -16,15 +16,15 @@ /** Samples for OnlineEndpoints Update. */ public final class OnlineEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/OnlineEndpoint/update.json */ /** - * Sample code: Update Online Endpoint. + * Sample code: Update Workspace Online Endpoint. * * @param manager Entry point to MachineLearningManager. */ - public static void updateOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { + public static void updateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { OnlineEndpoint resource = manager .onlineEndpoints() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java index ed6fb8689f40b..519ddf4bc4f16 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/operationsList.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/operationsList.json */ /** * Sample code: OperationsList. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index d694e37a8e51a..fc0a997bd2faf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.machinelearning.generated; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json */ /** * Sample code: WorkspacePutPrivateEndpointConnection. @@ -25,8 +25,8 @@ public static void workspacePutPrivateEndpointConnection( .withExistingWorkspace("rg-1234", "testworkspace") .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Auto-Approved")) + .withDescription("Auto-Approved") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) .create(); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java index b51239dd78d90..827966925d5c4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -7,14 +7,14 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/delete.json */ /** - * Sample code: WorkspaceDeletePrivateEndpointConnection. + * Sample code: WorkspacePutPrivateEndpointConnection. * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceDeletePrivateEndpointConnection( + public static void workspacePutPrivateEndpointConnection( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager .privateEndpointConnections() diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java index fae483260cc07..9aef0c4cceb75 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/get.json */ /** * Sample code: WorkspaceGetPrivateEndpointConnection. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java index b815609fb93ba..3aa7aa6aadd76 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateEndpointConnection/list.json */ /** * Sample code: StorageAccountListPrivateEndpointConnections. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java index 5f7ca342d38f5..54165017e07d4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateLinkResource/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/PrivateLinkResource/list.json */ /** * Sample code: WorkspaceListPrivateLinkResources. @@ -16,6 +16,6 @@ public final class PrivateLinkResourcesListSamples { */ public static void workspaceListPrivateLinkResources( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.privateLinkResources().listWithResponse("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.privateLinkResources().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java index da38aefba0644..4e4289fbfe9fc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java @@ -7,7 +7,7 @@ /** Samples for Quotas List. */ public final class QuotasListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Quota/list.json */ /** * Sample code: List workspace quotas by VMFamily. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java index 7a5911910cf1a..552cae6c1105f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for Quotas Update. */ public final class QuotasUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Quota/update.json */ /** * Sample code: update quotas. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e4afcb808f358 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries CreateOrUpdate. */ +public final class RegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/createOrUpdate-SystemCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")))))) + .create(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/createOrUpdate-UserCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withUserCreatedAcrAccount( + new UserCreatedAcrAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withUserCreatedStorageAccount( + new UserCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java new file mode 100644 index 0000000000000..76b84407c7e6a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/delete.json + */ + /** + * Sample code: Delete Registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().delete("test-rg", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c49208d73ac7a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/get-UserCreated.json + */ + /** + * Sample code: Get Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/get-SystemCreated.json + */ + /** + * Sample code: Get Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..f2fa18dde2a9a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/list-UserCreated.json + */ + /** + * Sample code: List registries with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/list-SystemCreated.json + */ + /** + * Sample code: List registries with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java new file mode 100644 index 0000000000000..ad52f3956b508 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries by subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesBySubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java new file mode 100644 index 0000000000000..baf7d15bbcaa4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries RemoveRegions. */ +public final class RegistriesRemoveRegionsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/removeRegions.json + */ + /** + * Sample code: Remove regions from registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void removeRegionsFromRegistry( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registries() + .removeRegions( + "test-rg", + "string", + new RegistryInner() + .withLocation("string") + .withTags(mapOf()) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku( + new Sku() + .withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays + .asList( + new RegistryPrivateEndpointConnection() + .withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState() + .withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails( + Arrays + .asList( + new RegistryRegionArmDetails() + .withAcrDetails( + Arrays + .asList( + new AcrDetails() + .withSystemCreatedAcrAccount( + new SystemCreatedAcrAccount() + .withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId( + new ArmResourceId().withResourceId("string"))) + .withUserCreatedAcrAccount( + new UserCreatedAcrAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails( + Arrays + .asList( + new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount() + .withAllowBlobPublicAccess(false) + .withArmResourceId( + new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")) + .withUserCreatedStorageAccount( + new UserCreatedStorageAccount() + .withArmResourceId( + new ArmResourceId().withResourceId("string"))))))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java new file mode 100644 index 0000000000000..b8730e5453ead --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/update-UserCreated.json + */ + /** + * Sample code: Update Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registries/update-SystemCreated.json + */ + /** + * Sample code: Update Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku( + new PartialSku() + .withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3de19eb92ea07 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryCodeContainers CreateOrUpdate. */ +public final class RegistryCodeContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "testregistry") + .withProperties( + new CodeContainerProperties() + .withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java new file mode 100644 index 0000000000000..4bcc3957f20e0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeContainers Delete. */ +public final class RegistryCodeContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/delete.json + */ + /** + * Sample code: Delete Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java new file mode 100644 index 0000000000000..b5187dc273d7b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeContainers Get. */ +public final class RegistryCodeContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/get.json + */ + /** + * Sample code: Get Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeContainers() + .getWithResponse("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java new file mode 100644 index 0000000000000..0884d2d686b7c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeContainers List. */ +public final class RegistryCodeContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeContainer/list.json + */ + /** + * Sample code: List Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryCodeContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers().list("testrg123", "testregistry", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..16bbcc9065ae6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryCodeVersions CreateOrGetStartPendingUpload. */ +public final class RegistryCodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..05d87607de290 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryCodeVersions CreateOrUpdate. */ +public final class RegistryCodeVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .define("string") + .withExistingCode("test-rg", "my-aml-registry", "string") + .withProperties( + new CodeVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java new file mode 100644 index 0000000000000..19b98a06e0bbc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeVersions Delete. */ +public final class RegistryCodeVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/delete.json + */ + /** + * Sample code: Delete Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java new file mode 100644 index 0000000000000..fcc35007ad3f7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeVersions Get. */ +public final class RegistryCodeVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/get.json + */ + /** + * Sample code: Get Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java new file mode 100644 index 0000000000000..22dcbd04942a8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryCodeVersions List. */ +public final class RegistryCodeVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/CodeVersion/list.json + */ + /** + * Sample code: List Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryCodeVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a7354c7213ddb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryComponentContainers CreateOrUpdate. */ +public final class RegistryComponentContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentContainers() + .define("string") + .withExistingRegistry("test-rg", "my-aml-registry") + .withProperties( + new ComponentContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java new file mode 100644 index 0000000000000..3e3789b8a8f03 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentContainers Delete. */ +public final class RegistryComponentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/delete.json + */ + /** + * Sample code: Delete Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentContainers() + .delete("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java new file mode 100644 index 0000000000000..9e908d1c52e11 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentContainers Get. */ +public final class RegistryComponentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/get.json + */ + /** + * Sample code: Get Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentContainers() + .getWithResponse("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java new file mode 100644 index 0000000000000..ca59456ede93f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentContainers List. */ +public final class RegistryComponentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentContainer/list.json + */ + /** + * Sample code: List Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentContainers() + .list("test-rg", "my-aml-registry", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..65af1d048fe25 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryComponentVersions CreateOrUpdate. */ +public final class RegistryComponentVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager + .registryComponentVersions() + .define("string") + .withExistingComponent("test-rg", "my-aml-registry", "string") + .withProperties( + new ComponentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withComponentSpec( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", + Object.class, + SerializerEncoding.JSON))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java new file mode 100644 index 0000000000000..5ad3ffa126194 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentVersions Delete. */ +public final class RegistryComponentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/delete.json + */ + /** + * Sample code: Delete Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java new file mode 100644 index 0000000000000..8ce10576693bf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentVersions Get. */ +public final class RegistryComponentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/get.json + */ + /** + * Sample code: Get Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java new file mode 100644 index 0000000000000..56535b5a9cbf0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryComponentVersions List. */ +public final class RegistryComponentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ComponentVersion/list.json + */ + /** + * Sample code: List Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryComponentVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..303e95cf66a0d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; +import com.azure.resourcemanager.machinelearning.models.DataType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryDataContainers CreateOrUpdate. */ +public final class RegistryDataContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataContainers() + .define("string") + .withExistingRegistry("test-rg", "registryName") + .withProperties( + new DataContainerProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false) + .withDataType(DataType.URI_FOLDER)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java new file mode 100644 index 0000000000000..5a518b127c367 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryDataContainers Delete. */ +public final class RegistryDataContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/delete.json + */ + /** + * Sample code: Delete Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers().delete("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java new file mode 100644 index 0000000000000..171cfcb6fdf5c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryDataContainers Get. */ +public final class RegistryDataContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/get.json + */ + /** + * Sample code: Get Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataContainers() + .getWithResponse("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java new file mode 100644 index 0000000000000..fa303dbd86992 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for RegistryDataContainers List. */ +public final class RegistryDataContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataContainer/registryList.json + */ + /** + * Sample code: RegistryList Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void registryListRegistryDataContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataContainers() + .list("test-rg", "registryName", null, ListViewType.ALL, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..3565474fdf610 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryDataVersions CreateOrGetStartPendingUpload. */ +public final class RegistryDataVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e945fe56fdcb1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.MLTableData; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryDataVersions CreateOrUpdate. */ +public final class RegistryDataVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataVersions() + .define("string") + .withExistingData("test-rg", "registryName", "string") + .withProperties( + new MLTableData() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withDataUri("string") + .withReferencedUris(Arrays.asList("string"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java new file mode 100644 index 0000000000000..4f4e3404f51e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryDataVersions Delete. */ +public final class RegistryDataVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/delete.json + */ + /** + * Sample code: Delete Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataVersions() + .delete("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java new file mode 100644 index 0000000000000..fb76f6bee88e9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryDataVersions Get. */ +public final class RegistryDataVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/get.json + */ + /** + * Sample code: Get Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataVersions() + .getWithResponse("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java new file mode 100644 index 0000000000000..ef6daf24a0434 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** Samples for RegistryDataVersions List. */ +public final class RegistryDataVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/DataVersionBase/registryList.json + */ + /** + * Sample code: RegistryList Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void registryListRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryDataVersions() + .list( + "test-rg", + "registryName", + "string", + "string", + 1, + null, + "string", + ListViewType.ARCHIVED_ONLY, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c1ef428ac520c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryEnvironmentContainers CreateOrUpdate. */ +public final class RegistryEnvironmentContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentContainers() + .define("testEnvironment") + .withExistingRegistry("testrg123", "testregistry") + .withProperties( + new EnvironmentContainerProperties() + .withDescription("string") + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java new file mode 100644 index 0000000000000..c6ee4fa6b694f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentContainers Delete. */ +public final class RegistryEnvironmentContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/delete.json + */ + /** + * Sample code: Delete Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java new file mode 100644 index 0000000000000..392ed72637409 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentContainers Get. */ +public final class RegistryEnvironmentContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/get.json + */ + /** + * Sample code: Get Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentContainers() + .getWithResponse("testrg123", "testregistry", "testEnvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java new file mode 100644 index 0000000000000..f70cc57f06fb8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentContainers List. */ +public final class RegistryEnvironmentContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentContainer/list.json + */ + /** + * Sample code: List Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentContainers() + .list("testrg123", "testregistry", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..df02ccacd0054 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.BuildContext; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; +import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; +import com.azure.resourcemanager.machinelearning.models.Route; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryEnvironmentVersions CreateOrUpdate. */ +public final class RegistryEnvironmentVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentVersions() + .define("string") + .withExistingEnvironment("test-rg", "my-aml-registry", "string") + .withProperties( + new EnvironmentVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild( + new BuildContext() + .withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties() + .withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java new file mode 100644 index 0000000000000..21d116a96a6c4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentVersions Delete. */ +public final class RegistryEnvironmentVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/delete.json + */ + /** + * Sample code: Delete Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java new file mode 100644 index 0000000000000..f5e1234bf4f91 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentVersions Get. */ +public final class RegistryEnvironmentVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/get.json + */ + /** + * Sample code: Get Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java new file mode 100644 index 0000000000000..83f1eb0da0632 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryEnvironmentVersions List. */ +public final class RegistryEnvironmentVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/EnvironmentVersion/list.json + */ + /** + * Sample code: List Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryEnvironmentVersions() + .list( + "test-rg", + "my-aml-regsitry", + "string", + "string", + 1, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ba50fd0608ec9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryModelContainers CreateOrUpdate. */ +public final class RegistryModelContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "registry123") + .withProperties( + new ModelContainerProperties() + .withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java new file mode 100644 index 0000000000000..fc248b88624c1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelContainers Delete. */ +public final class RegistryModelContainersDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/delete.json + */ + /** + * Sample code: Delete Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .delete("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java new file mode 100644 index 0000000000000..93c26bace9e6b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelContainers Get. */ +public final class RegistryModelContainersGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/get.json + */ + /** + * Sample code: Get Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .getWithResponse("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java new file mode 100644 index 0000000000000..35fba99fe55ba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelContainers List. */ +public final class RegistryModelContainersListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelContainer/list.json + */ + /** + * Sample code: List Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelContainers() + .list("testrg123", "registry123", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..a35a92f1d752e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** Samples for RegistryModelVersions CreateOrGetStartPendingUpload. */ +public final class RegistryModelVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .createOrGetStartPendingUploadWithResponse( + "test-rg", + "registryName", + "string", + "string", + new PendingUploadRequestDto() + .withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..757770cff5d42 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryModelVersions CreateOrUpdate. */ +public final class RegistryModelVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .define("string") + .withExistingModel("test-rg", "my-aml-registry", "string") + .withProperties( + new ModelVersionProperties() + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java new file mode 100644 index 0000000000000..c3c8c26d4f0d9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelVersions Delete. */ +public final class RegistryModelVersionsDeleteSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/delete.json + */ + /** + * Sample code: Delete Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java new file mode 100644 index 0000000000000..c598f0061eb28 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelVersions Get. */ +public final class RegistryModelVersionsGetSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/get.json + */ + /** + * Sample code: Get Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java new file mode 100644 index 0000000000000..8235d9ae718fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for RegistryModelVersions List. */ +public final class RegistryModelVersionsListSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/list.json + */ + /** + * Sample code: List Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .list( + "test-rg", + "my-aml-registry", + "string", + null, + "string", + 1, + "string", + "string", + "string", + "string", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsPackageMethodSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsPackageMethodSamples.java new file mode 100644 index 0000000000000..dc74eb7d7df91 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsPackageMethodSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.AzureMLBatchInferencingServer; +import com.azure.resourcemanager.machinelearning.models.BaseEnvironmentId; +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelConfiguration; +import com.azure.resourcemanager.machinelearning.models.ModelPackageInput; +import com.azure.resourcemanager.machinelearning.models.PackageInputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PackageInputPathUrl; +import com.azure.resourcemanager.machinelearning.models.PackageInputType; +import com.azure.resourcemanager.machinelearning.models.PackageRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RegistryModelVersions PackageMethod. */ +public final class RegistryModelVersionsPackageMethodSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Registry/ModelVersion/package.json + */ + /** + * Sample code: Package Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void packageRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .registryModelVersions() + .packageMethod( + "test-rg", + "my-aml-registry", + "string", + "string", + new PackageRequest() + .withBaseEnvironmentSource(new BaseEnvironmentId().withResourceId("string")) + .withEnvironmentVariables(mapOf("string", "string")) + .withInferencingServer( + new AzureMLBatchInferencingServer() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string"))) + .withInputs( + Arrays + .asList( + new ModelPackageInput() + .withInputType(PackageInputType.URI_FILE) + .withMode(PackageInputDeliveryMode.DOWNLOAD) + .withMountPath("string") + .withPath(new PackageInputPathUrl().withUrl("string")))) + .withModelConfiguration( + new ModelConfiguration() + .withMode(PackageInputDeliveryMode.fromString("ReadOnlyMount")) + .withMountPath("string")) + .withTags(mapOf("string", "string")) + .withTargetEnvironmentId("string"), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java index f58b680aaf5b0..e19ec1527830b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java @@ -16,7 +16,7 @@ /** Samples for Schedules CreateOrUpdate. */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/createOrUpdate.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Schedule. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java index 8425d2bdae803..7a75ce20f36f5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Schedules Delete. */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/delete.json */ /** * Sample code: Delete Schedule. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java index ed4851ee6751a..f5a6a0c14c4a7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Schedules Get. */ public final class SchedulesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/get.json */ /** * Sample code: Get Schedule. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java index a73377880c36f..f85888a7f12ff 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java @@ -7,7 +7,7 @@ /** Samples for Schedules List. */ public final class SchedulesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Schedule/list.json */ /** * Sample code: List Schedules. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java index 610f0219a60a3..cf0c9adc99e0d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java @@ -7,7 +7,7 @@ /** Samples for Usages List. */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Usage/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Usage/list.json */ /** * Sample code: List Usages. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java index bd3b35c93152d..1e5f71fd635d6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java @@ -7,7 +7,7 @@ /** Samples for VirtualMachineSizes List. */ public final class VirtualMachineSizesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/VirtualMachineSize/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/VirtualMachineSize/list.json */ /** * Sample code: List VM Sizes. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java index ee18b1460db3a..a395a5ccb5932 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java @@ -6,11 +6,12 @@ import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; +import java.time.OffsetDateTime; /** Samples for WorkspaceConnections Create. */ public final class WorkspaceConnectionsCreateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/create.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. @@ -26,6 +27,7 @@ public static void createWorkspaceConnection( .withProperties( new NoneAuthTypeWorkspaceConnectionProperties() .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) .withTarget("www.facebook.com")) .create(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java index 70584254ef26d..e0db3d6cafcfa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for WorkspaceConnections Delete. */ public final class WorkspaceConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/delete.json */ /** * Sample code: DeleteWorkspaceConnection. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java index c5c1c28e42fd3..763b30fd2cbfa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for WorkspaceConnections Get. */ public final class WorkspaceConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/get.json */ /** * Sample code: GetWorkspaceConnection. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java index a555209830d68..aac76a07a0763 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java @@ -7,7 +7,7 @@ /** Samples for WorkspaceConnections List. */ public final class WorkspaceConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/list.json */ /** * Sample code: ListWorkspaceConnections. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java new file mode 100644 index 0000000000000..e60fc6d1d2d1f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** Samples for WorkspaceConnections ListSecrets. */ +public final class WorkspaceConnectionsListSecretsSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/listSecrets.json + */ + /** + * Sample code: GetWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager + .workspaceConnections() + .listSecretsWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsUpdateSamples.java new file mode 100644 index 0000000000000..5c4fac88b1b78 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.AccessKeyAuthTypeWorkspaceConnectionProperties; +import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionAccessKey; +import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** Samples for WorkspaceConnections Update. */ +public final class WorkspaceConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceConnection/update.json + */ + /** + * Sample code: UpdateWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + WorkspaceConnectionPropertiesV2BasicResource resource = + manager + .workspaceConnections() + .getWithResponse("test-rg", "aml-workspace-name", "some_string", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AccessKeyAuthTypeWorkspaceConnectionProperties() + .withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withTarget("some_string") + .withCredentials( + new WorkspaceConnectionAccessKey() + .withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java index a2e9ec836c5de..1dc8feed33421 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java @@ -7,7 +7,7 @@ /** Samples for WorkspaceFeatures List. */ public final class WorkspaceFeaturesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceFeature/list.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/WorkspaceFeature/list.json */ /** * Sample code: List Workspace features. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java index f4db9bbdf9ca2..9c94c037f4eb0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.machinelearning.generated; -import com.azure.resourcemanager.machinelearning.models.EncryptionKeyVaultProperties; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; import com.azure.resourcemanager.machinelearning.models.EncryptionStatus; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.IdentityForCmk; +import com.azure.resourcemanager.machinelearning.models.KeyVaultProperties; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; import java.util.Arrays; @@ -20,7 +20,7 @@ /** Samples for Workspaces CreateOrUpdate. */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/create.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. @@ -40,39 +40,39 @@ public static void createWorkspace(com.azure.resourcemanager.machinelearning.Mac mapOf( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", new UserAssignedIdentity()))) - .withDescription("test description") - .withFriendlyName("HelloName") - .withKeyVault( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv") .withApplicationInsights( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights") .withContainerRegistry( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry") - .withStorageAccount( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") + .withDescription("test description") .withEncryption( new EncryptionProperty() - .withStatus(EncryptionStatus.ENABLED) .withIdentity( new IdentityForCmk() .withUserAssignedIdentity( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) .withKeyVaultProperties( - new EncryptionKeyVaultProperties() - .withKeyVaultArmId("fakeTokenPlaceholder") + new KeyVaultProperties() + .withIdentityClientId("") .withKeyIdentifier("fakeTokenPlaceholder") - .withIdentityClientId(""))) + .withKeyVaultArmId("fakeTokenPlaceholder")) + .withStatus(EncryptionStatus.ENABLED)) + .withFriendlyName("HelloName") .withHbiWorkspace(false) + .withKeyVault( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv") .withSharedPrivateLinkResources( Arrays .asList( new SharedPrivateLinkResource() .withName("testdbresource") + .withGroupId("Sql") .withPrivateLinkResourceId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") - .withGroupId("Sql") .withRequestMessage("Please approve") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) + .withStatus(EndpointServiceConnectionStatus.APPROVED))) + .withStorageAccount( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") .create(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java index c1fd156d125f6..8a74d2534c6d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces Delete. */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/delete.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. @@ -15,6 +15,6 @@ public final class WorkspacesDeleteSamples { * @param manager Entry point to MachineLearningManager. */ public static void deleteWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().delete("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces().delete("workspace-1234", "testworkspace", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java index 686192ecc6e0c..cc64529fb0311 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java @@ -12,7 +12,7 @@ /** Samples for Workspaces Diagnose. */ public final class WorkspacesDiagnoseSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/diagnose.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. @@ -28,15 +28,15 @@ public static void diagnoseWorkspace(com.azure.resourcemanager.machinelearning.M new DiagnoseWorkspaceParameters() .withValue( new DiagnoseRequestProperties() - .withUdr(mapOf()) + .withApplicationInsights(mapOf()) + .withContainerRegistry(mapOf()) + .withDnsResolution(mapOf()) + .withKeyVault(mapOf()) .withNsg(mapOf()) + .withOthers(mapOf()) .withResourceLock(mapOf()) - .withDnsResolution(mapOf()) .withStorageAccount(mapOf()) - .withKeyVault(mapOf()) - .withContainerRegistry(mapOf()) - .withApplicationInsights(mapOf()) - .withOthers(mapOf())), + .withUdr(mapOf())), com.azure.core.util.Context.NONE); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java index 179c4e8e29b0b..c88a52ed24ae0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces GetByResourceGroup. */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/get.json */ /** * Sample code: Get Workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java index 669be8f3e6d32..6f55312eecdae 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListByResourceGroup. */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listByResourceGroup.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. @@ -16,6 +16,6 @@ public final class WorkspacesListByResourceGroupSamples { */ public static void getWorkspacesByResourceGroup( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().listByResourceGroup("workspace-1234", null, com.azure.core.util.Context.NONE); + manager.workspaces().listByResourceGroup("workspace-1234", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java index ccbe6102435a5..80339bd6b96f7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListKeys. */ public final class WorkspacesListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listKeys.json */ /** * Sample code: List Workspace Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java index ef8427324993f..56e645c71debd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListNotebookAccessToken. */ public final class WorkspacesListNotebookAccessTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listNotebookAccessToken.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listNotebookAccessToken.json */ /** * Sample code: List Workspace Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java index 3e287c705f692..be10bd2caa865 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListNotebookKeys. */ public final class WorkspacesListNotebookKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/listKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Notebook/listKeys.json */ /** * Sample code: List Workspace Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java index efa218684f9b3..4369192589d8c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. */ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ExternalFQDN/get.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/ExternalFQDN/get.json */ /** * Sample code: ListOutboundNetworkDependenciesEndpoints. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java index 75c206e34e8ab..c333866ed89a3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces List. */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listBySubscription.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. @@ -16,6 +16,6 @@ public final class WorkspacesListSamples { */ public static void getWorkspacesBySubscription( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().list(null, com.azure.core.util.Context.NONE); + manager.workspaces().list(null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java index 9394db609d6c0..b88d62551b893 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ListStorageAccountKeys. */ public final class WorkspacesListStorageAccountKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listStorageAccountKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/listStorageAccountKeys.json */ /** * Sample code: List Workspace Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java index 127a903e671c4..d9a5790829230 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces PrepareNotebook. */ public final class WorkspacesPrepareNotebookSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/prepare.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Notebook/prepare.json */ /** * Sample code: Prepare Notebook. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java index 6f3d88cf74730..a7b0812cbedbb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Workspaces ResyncKeys. */ public final class WorkspacesResyncKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/resyncKeys.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/resyncKeys.json */ /** * Sample code: Resync Workspace Keys. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java index 5eb660d26642b..e2a528f26cce1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.machinelearning.generated; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; import com.azure.resourcemanager.machinelearning.models.Workspace; /** Samples for Workspaces Update. */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/update.json + * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-08-01-preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. @@ -27,7 +27,7 @@ public static void updateWorkspace(com.azure.resourcemanager.machinelearning.Mac .update() .withDescription("new description") .withFriendlyName("New friendly name") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED) .apply(); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java deleted file mode 100644 index c7c3e2424e74e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AksNetworkingConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class AksNetworkingConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AksNetworkingConfiguration model = - BinaryData - .fromString( - "{\"subnetId\":\"pilguooqjag\",\"serviceCidr\":\"itgueiookjbs\",\"dnsServiceIP\":\"rtdtpdelq\",\"dockerBridgeCidr\":\"slmot\"}") - .toObject(AksNetworkingConfiguration.class); - Assertions.assertEquals("pilguooqjag", model.subnetId()); - Assertions.assertEquals("itgueiookjbs", model.serviceCidr()); - Assertions.assertEquals("rtdtpdelq", model.dnsServiceIp()); - Assertions.assertEquals("slmot", model.dockerBridgeCidr()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AksNetworkingConfiguration model = - new AksNetworkingConfiguration() - .withSubnetId("pilguooqjag") - .withServiceCidr("itgueiookjbs") - .withDnsServiceIp("rtdtpdelq") - .withDockerBridgeCidr("slmot"); - model = BinaryData.fromObject(model).toObject(AksNetworkingConfiguration.class); - Assertions.assertEquals("pilguooqjag", model.subnetId()); - Assertions.assertEquals("itgueiookjbs", model.serviceCidr()); - Assertions.assertEquals("rtdtpdelq", model.dnsServiceIp()); - Assertions.assertEquals("slmot", model.dockerBridgeCidr()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java deleted file mode 100644 index 382335e46a8b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; - -public final class AmlComputeNodeInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlComputeNodeInformation model = - BinaryData - .fromString( - "{\"nodeId\":\"hsmtxpsiebtfhvp\",\"privateIpAddress\":\"apskrdqm\",\"publicIpAddress\":\"jdhtldwkyzxu\",\"port\":379697539,\"nodeState\":\"unusable\",\"runId\":\"scwsv\"}") - .toObject(AmlComputeNodeInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlComputeNodeInformation model = new AmlComputeNodeInformation(); - model = BinaryData.fromObject(model).toObject(AmlComputeNodeInformation.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java deleted file mode 100644 index bdb79d003a025..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodesInformation; - -public final class AmlComputeNodesInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlComputeNodesInformation model = - BinaryData - .fromString( - "{\"nodes\":[{\"nodeId\":\"zjancuxr\",\"privateIpAddress\":\"wbavxbniwdj\",\"publicIpAddress\":\"zt\",\"port\":593552862,\"nodeState\":\"unusable\",\"runId\":\"xytxhpzxbz\"},{\"nodeId\":\"zabglcuhxwt\",\"privateIpAddress\":\"yqiklbbovplwzb\",\"publicIpAddress\":\"gy\",\"port\":1408848677,\"nodeState\":\"idle\",\"runId\":\"mkfssxqukkfplgm\"},{\"nodeId\":\"xnkjzkdesl\",\"privateIpAddress\":\"lopwiyig\",\"publicIpAddress\":\"pkdwzbai\",\"port\":830727700,\"nodeState\":\"unusable\",\"runId\":\"m\"}],\"nextLink\":\"qupedeojnab\"}") - .toObject(AmlComputeNodesInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlComputeNodesInformation model = new AmlComputeNodesInformation(); - model = BinaryData.fromObject(model).toObject(AmlComputeNodesInformation.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java deleted file mode 100644 index 4dd999feefe24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"gjofjd\",\"resource\":\"qs\",\"operation\":\"eupewnwreitjz\",\"description\":\"lusarh\"}") - .toObject(AmlOperationDisplay.class); - Assertions.assertEquals("gjofjd", model.provider()); - Assertions.assertEquals("qs", model.resource()); - Assertions.assertEquals("eupewnwreitjz", model.operation()); - Assertions.assertEquals("lusarh", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationDisplay model = - new AmlOperationDisplay() - .withProvider("gjofjd") - .withResource("qs") - .withOperation("eupewnwreitjz") - .withDescription("lusarh"); - model = BinaryData.fromObject(model).toObject(AmlOperationDisplay.class); - Assertions.assertEquals("gjofjd", model.provider()); - Assertions.assertEquals("qs", model.resource()); - Assertions.assertEquals("eupewnwreitjz", model.operation()); - Assertions.assertEquals("lusarh", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java deleted file mode 100644 index 2259819743556..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationInner model = - BinaryData - .fromString( - "{\"name\":\"siznto\",\"display\":{\"provider\":\"a\",\"resource\":\"ajpsquc\",\"operation\":\"o\",\"description\":\"dkfo\"},\"isDataAction\":false}") - .toObject(AmlOperationInner.class); - Assertions.assertEquals("siznto", model.name()); - Assertions.assertEquals("a", model.display().provider()); - Assertions.assertEquals("ajpsquc", model.display().resource()); - Assertions.assertEquals("o", model.display().operation()); - Assertions.assertEquals("dkfo", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationInner model = - new AmlOperationInner() - .withName("siznto") - .withDisplay( - new AmlOperationDisplay() - .withProvider("a") - .withResource("ajpsquc") - .withOperation("o") - .withDescription("dkfo")) - .withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(AmlOperationInner.class); - Assertions.assertEquals("siznto", model.name()); - Assertions.assertEquals("a", model.display().provider()); - Assertions.assertEquals("ajpsquc", model.display().resource()); - Assertions.assertEquals("o", model.display().operation()); - Assertions.assertEquals("dkfo", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java deleted file mode 100644 index 5401da3f66c4b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import com.azure.resourcemanager.machinelearning.models.AmlOperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false},{\"name\":\"noi\",\"display\":{\"provider\":\"lrxybqsoq\",\"resource\":\"gkdmb\",\"operation\":\"zlobcufpd\",\"description\":\"rbt\"},\"isDataAction\":true},{\"name\":\"nq\",\"display\":{\"provider\":\"qgn\",\"resource\":\"ooojywifsqe\",\"operation\":\"agdfmglzlh\",\"description\":\"rifkwm\"},\"isDataAction\":true}]}") - .toObject(AmlOperationListResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationListResult model = - new AmlOperationListResult() - .withValue( - Arrays - .asList( - new AmlOperationInner() - .withName("quvgjxpybczme") - .withDisplay( - new AmlOperationDisplay() - .withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withIsDataAction(false), - new AmlOperationInner() - .withName("noi") - .withDisplay( - new AmlOperationDisplay() - .withProvider("lrxybqsoq") - .withResource("gkdmb") - .withOperation("zlobcufpd") - .withDescription("rbt")) - .withIsDataAction(true), - new AmlOperationInner() - .withName("nq") - .withDisplay( - new AmlOperationDisplay() - .withProvider("qgn") - .withResource("ooojywifsqe") - .withOperation("agdfmglzlh") - .withDescription("rifkwm")) - .withIsDataAction(true))); - model = BinaryData.fromObject(model).toObject(AmlOperationListResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java deleted file mode 100644 index 4500fbd744095..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlToken; - -public final class AmlTokenTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlToken model = BinaryData.fromString("{\"identityType\":\"AMLToken\"}").toObject(AmlToken.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlToken model = new AmlToken(); - model = BinaryData.fromObject(model).toObject(AmlToken.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java deleted file mode 100644 index acef398e64afe..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner; -import org.junit.jupiter.api.Assertions; - -public final class AmlUserFeatureInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlUserFeatureInner model = - BinaryData - .fromString("{\"id\":\"pkt\",\"displayName\":\"ylkmqp\",\"description\":\"yhlfb\"}") - .toObject(AmlUserFeatureInner.class); - Assertions.assertEquals("pkt", model.id()); - Assertions.assertEquals("ylkmqp", model.displayName()); - Assertions.assertEquals("yhlfb", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlUserFeatureInner model = - new AmlUserFeatureInner().withId("pkt").withDisplayName("ylkmqp").withDescription("yhlfb"); - model = BinaryData.fromObject(model).toObject(AmlUserFeatureInner.class); - Assertions.assertEquals("pkt", model.id()); - Assertions.assertEquals("ylkmqp", model.displayName()); - Assertions.assertEquals("yhlfb", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java deleted file mode 100644 index bf7b889c21a85..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssetBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetBase model = - BinaryData - .fromString( - "{\"isAnonymous\":false,\"isArchived\":false,\"description\":\"szfjvfbgofelja\",\"properties\":{\"ojnal\":\"mqhldvrii\",\"qhhahhxvrhmzkwpj\":\"hfkvtvsexsowuel\",\"ughftqsx\":\"wws\"},\"tags\":{\"grjguufzd\":\"ujxukndxd\",\"whbotzingamv\":\"syqtfi\"}}") - .toObject(AssetBase.class); - Assertions.assertEquals("szfjvfbgofelja", model.description()); - Assertions.assertEquals("mqhldvrii", model.properties().get("ojnal")); - Assertions.assertEquals("ujxukndxd", model.tags().get("grjguufzd")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetBase model = - new AssetBase() - .withDescription("szfjvfbgofelja") - .withProperties(mapOf("ojnal", "mqhldvrii", "qhhahhxvrhmzkwpj", "hfkvtvsexsowuel", "ughftqsx", "wws")) - .withTags(mapOf("grjguufzd", "ujxukndxd", "whbotzingamv", "syqtfi")) - .withIsAnonymous(false) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(AssetBase.class); - Assertions.assertEquals("szfjvfbgofelja", model.description()); - Assertions.assertEquals("mqhldvrii", model.properties().get("ojnal")); - Assertions.assertEquals("ujxukndxd", model.tags().get("grjguufzd")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java deleted file mode 100644 index 68efc629022b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetContainer; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssetContainerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetContainer model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"qnyhgb\",\"nextVersion\":\"tjivfxzsjabib\",\"description\":\"stawfsdjpvkv\",\"properties\":{\"budurgkakmo\":\"xbkzbzkdvncj\",\"gzrf\":\"zhjjklffhmouwq\",\"ikayuhqlbjbsybb\":\"eeyebi\"},\"tags\":{\"slthaq\":\"vtldgmfpgvmpip\"}}") - .toObject(AssetContainer.class); - Assertions.assertEquals("stawfsdjpvkv", model.description()); - Assertions.assertEquals("xbkzbzkdvncj", model.properties().get("budurgkakmo")); - Assertions.assertEquals("vtldgmfpgvmpip", model.tags().get("slthaq")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetContainer model = - new AssetContainer() - .withDescription("stawfsdjpvkv") - .withProperties( - mapOf("budurgkakmo", "xbkzbzkdvncj", "gzrf", "zhjjklffhmouwq", "ikayuhqlbjbsybb", "eeyebi")) - .withTags(mapOf("slthaq", "vtldgmfpgvmpip")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(AssetContainer.class); - Assertions.assertEquals("stawfsdjpvkv", model.description()); - Assertions.assertEquals("xbkzbzkdvncj", model.properties().get("budurgkakmo")); - Assertions.assertEquals("vtldgmfpgvmpip", model.tags().get("slthaq")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java deleted file mode 100644 index b29a8197e2ab3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class AssetJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetJobInput model = - BinaryData.fromString("{\"mode\":\"ReadOnlyMount\",\"uri\":\"fgbrtt\"}").toObject(AssetJobInput.class); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("fgbrtt", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetJobInput model = new AssetJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT).withUri("fgbrtt"); - model = BinaryData.fromObject(model).toObject(AssetJobInput.class); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("fgbrtt", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java deleted file mode 100644 index 9b241f855a052..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class AssetJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetJobOutput model = - BinaryData.fromString("{\"mode\":\"Upload\",\"uri\":\"lkiexhajlfnthiq\"}").toObject(AssetJobOutput.class); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("lkiexhajlfnthiq", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetJobOutput model = new AssetJobOutput().withMode(OutputDeliveryMode.UPLOAD).withUri("lkiexhajlfnthiq"); - model = BinaryData.fromObject(model).toObject(AssetJobOutput.class); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("lkiexhajlfnthiq", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java deleted file mode 100644 index 11357aca4ae81..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetReferenceBase; - -public final class AssetReferenceBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetReferenceBase model = - BinaryData.fromString("{\"referenceType\":\"AssetReferenceBase\"}").toObject(AssetReferenceBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetReferenceBase model = new AssetReferenceBase(); - model = BinaryData.fromObject(model).toObject(AssetReferenceBase.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java deleted file mode 100644 index 0ee7c299110b0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssignedUser; -import org.junit.jupiter.api.Assertions; - -public final class AssignedUserTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssignedUser model = - BinaryData - .fromString("{\"objectId\":\"mykyujxsglhs\",\"tenantId\":\"rryejylmbkzudnig\"}") - .toObject(AssignedUser.class); - Assertions.assertEquals("mykyujxsglhs", model.objectId()); - Assertions.assertEquals("rryejylmbkzudnig", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssignedUser model = new AssignedUser().withObjectId("mykyujxsglhs").withTenantId("rryejylmbkzudnig"); - model = BinaryData.fromObject(model).toObject(AssignedUser.class); - Assertions.assertEquals("mykyujxsglhs", model.objectId()); - Assertions.assertEquals("rryejylmbkzudnig", model.tenantId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java deleted file mode 100644 index 44430f0e8225b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoForecastHorizon; - -public final class AutoForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoForecastHorizon model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoForecastHorizon.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoForecastHorizon model = new AutoForecastHorizon(); - model = BinaryData.fromObject(model).toObject(AutoForecastHorizon.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java deleted file mode 100644 index 789779d401001..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoMLJob; -import com.azure.resourcemanager.machinelearning.models.AutoMLVertical; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutoMLJobTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoMLJob model = - BinaryData - .fromString( - "{\"jobType\":\"AutoML\",\"environmentId\":\"uttdiygbp\",\"environmentVariables\":{\"ctwwgzw\":\"swmtxk\",\"og\":\"jlmec\"},\"outputs\":{\"zaifghtmoqqtlff\":{\"jobOutputType\":\"JobOutput\",\"description\":\"vne\"},\"avfqnvhnqoewdogi\":{\"jobOutputType\":\"JobOutput\",\"description\":\"bkrkjj\"},\"t\":{\"jobOutputType\":\"JobOutput\",\"description\":\"tesypvidbztjh\"},\"p\":{\"jobOutputType\":\"JobOutput\",\"description\":\"ovnynkbwetnju\"}},\"resources\":{\"dockerArgs\":\"kzyaup\",\"shmSize\":\"ccxnafbwqroohtuo\",\"instanceCount\":339434421,\"instanceType\":\"nur\",\"properties\":{\"ecmslclbl\":\"datamghihp\",\"bsjuscvsfx\":\"datajxl\",\"cydrtceukdqkk\":\"datagctmgxuupbezq\",\"chillcecf\":\"dataihztgeqmgqzgwldo\"}},\"taskDetails\":{\"taskType\":\"AutoMLVertical\",\"logVerbosity\":\"Debug\",\"targetColumnName\":\"aoaguhicqlli\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"ac\",\"description\":\"vhrweftkwqejpmv\"}},\"componentId\":\"ehaepwamcxtc\",\"computeId\":\"upeuknijduyye\",\"displayName\":\"ydjfb\",\"experimentName\":\"yv\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"xjcmmzrrsc\":{\"endpoint\":\"wikdmh\",\"errorMessage\":\"kuflgbh\",\"jobServiceType\":\"uacdixmxuf\",\"port\":2084049172,\"properties\":{\"kfnozoeoqbvj\":\"qg\",\"ay\":\"vefgwbmqjchntas\",\"wyvf\":\"xbulpzealbmqkyo\"},\"status\":\"btsuahxs\"},\"k\":{\"endpoint\":\"i\",\"errorMessage\":\"drnpxqwodiff\",\"jobServiceType\":\"cjrmmua\",\"port\":1056195369,\"properties\":{\"e\":\"jogjonmc\",\"akpoldtvevbo\":\"oyzbamwineofvf\",\"zjknyuxg\":\"lz\",\"mrdixtreki\":\"ttxpnrupza\"},\"status\":\"wyskbruffgll\"}},\"status\":\"Paused\",\"description\":\"lxhrp\",\"properties\":{\"iryr\":\"mblcouqehbhbcds\",\"pmbltoormkfql\":\"ndo\",\"nbmjksibjgsjjxxa\":\"xldykalsygaolnjp\"},\"tags\":{\"gxyivpinbmh\":\"nadzyq\",\"bkezn\":\"bjijkgqxnh\",\"nggiycwkdtaa\":\"aujvaa\",\"ekaum\":\"xw\"}}") - .toObject(AutoMLJob.class); - Assertions.assertEquals("lxhrp", model.description()); - Assertions.assertEquals("mblcouqehbhbcds", model.properties().get("iryr")); - Assertions.assertEquals("nadzyq", model.tags().get("gxyivpinbmh")); - Assertions.assertEquals("ehaepwamcxtc", model.componentId()); - Assertions.assertEquals("upeuknijduyye", model.computeId()); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("wikdmh", model.services().get("xjcmmzrrsc").endpoint()); - Assertions.assertEquals("uacdixmxuf", model.services().get("xjcmmzrrsc").jobServiceType()); - Assertions.assertEquals(2084049172, model.services().get("xjcmmzrrsc").port()); - Assertions.assertEquals("qg", model.services().get("xjcmmzrrsc").properties().get("kfnozoeoqbvj")); - Assertions.assertEquals("uttdiygbp", model.environmentId()); - Assertions.assertEquals("swmtxk", model.environmentVariables().get("ctwwgzw")); - Assertions.assertEquals("vne", model.outputs().get("zaifghtmoqqtlff").description()); - Assertions.assertEquals(339434421, model.resources().instanceCount()); - Assertions.assertEquals("nur", model.resources().instanceType()); - Assertions.assertEquals("kzyaup", model.resources().dockerArgs()); - Assertions.assertEquals("ccxnafbwqroohtuo", model.resources().shmSize()); - Assertions.assertEquals(LogVerbosity.DEBUG, model.taskDetails().logVerbosity()); - Assertions.assertEquals("aoaguhicqlli", model.taskDetails().targetColumnName()); - Assertions.assertEquals("vhrweftkwqejpmv", model.taskDetails().trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.taskDetails().trainingData().mode()); - Assertions.assertEquals("ac", model.taskDetails().trainingData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoMLJob model = - new AutoMLJob() - .withDescription("lxhrp") - .withProperties( - mapOf("iryr", "mblcouqehbhbcds", "pmbltoormkfql", "ndo", "nbmjksibjgsjjxxa", "xldykalsygaolnjp")) - .withTags( - mapOf("gxyivpinbmh", "nadzyq", "bkezn", "bjijkgqxnh", "nggiycwkdtaa", "aujvaa", "ekaum", "xw")) - .withComponentId("ehaepwamcxtc") - .withComputeId("upeuknijduyye") - .withDisplayName("ydjfb") - .withExperimentName("yv") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "xjcmmzrrsc", - new JobService() - .withEndpoint("wikdmh") - .withJobServiceType("uacdixmxuf") - .withPort(2084049172) - .withProperties( - mapOf("kfnozoeoqbvj", "qg", "ay", "vefgwbmqjchntas", "wyvf", "xbulpzealbmqkyo")), - "k", - new JobService() - .withEndpoint("i") - .withJobServiceType("cjrmmua") - .withPort(1056195369) - .withProperties( - mapOf( - "e", - "jogjonmc", - "akpoldtvevbo", - "oyzbamwineofvf", - "zjknyuxg", - "lz", - "mrdixtreki", - "ttxpnrupza")))) - .withEnvironmentId("uttdiygbp") - .withEnvironmentVariables(mapOf("ctwwgzw", "swmtxk", "og", "jlmec")) - .withOutputs( - mapOf( - "zaifghtmoqqtlff", - new JobOutput().withDescription("vne"), - "avfqnvhnqoewdogi", - new JobOutput().withDescription("bkrkjj"), - "t", - new JobOutput().withDescription("tesypvidbztjh"), - "p", - new JobOutput().withDescription("ovnynkbwetnju"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(339434421) - .withInstanceType("nur") - .withProperties( - mapOf( - "ecmslclbl", - "datamghihp", - "bsjuscvsfx", - "datajxl", - "cydrtceukdqkk", - "datagctmgxuupbezq", - "chillcecf", - "dataihztgeqmgqzgwldo")) - .withDockerArgs("kzyaup") - .withShmSize("ccxnafbwqroohtuo")) - .withTaskDetails( - new AutoMLVertical() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("aoaguhicqlli") - .withTrainingData( - new MLTableJobInput() - .withDescription("vhrweftkwqejpmv") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("ac"))); - model = BinaryData.fromObject(model).toObject(AutoMLJob.class); - Assertions.assertEquals("lxhrp", model.description()); - Assertions.assertEquals("mblcouqehbhbcds", model.properties().get("iryr")); - Assertions.assertEquals("nadzyq", model.tags().get("gxyivpinbmh")); - Assertions.assertEquals("ehaepwamcxtc", model.componentId()); - Assertions.assertEquals("upeuknijduyye", model.computeId()); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("wikdmh", model.services().get("xjcmmzrrsc").endpoint()); - Assertions.assertEquals("uacdixmxuf", model.services().get("xjcmmzrrsc").jobServiceType()); - Assertions.assertEquals(2084049172, model.services().get("xjcmmzrrsc").port()); - Assertions.assertEquals("qg", model.services().get("xjcmmzrrsc").properties().get("kfnozoeoqbvj")); - Assertions.assertEquals("uttdiygbp", model.environmentId()); - Assertions.assertEquals("swmtxk", model.environmentVariables().get("ctwwgzw")); - Assertions.assertEquals("vne", model.outputs().get("zaifghtmoqqtlff").description()); - Assertions.assertEquals(339434421, model.resources().instanceCount()); - Assertions.assertEquals("nur", model.resources().instanceType()); - Assertions.assertEquals("kzyaup", model.resources().dockerArgs()); - Assertions.assertEquals("ccxnafbwqroohtuo", model.resources().shmSize()); - Assertions.assertEquals(LogVerbosity.DEBUG, model.taskDetails().logVerbosity()); - Assertions.assertEquals("aoaguhicqlli", model.taskDetails().targetColumnName()); - Assertions.assertEquals("vhrweftkwqejpmv", model.taskDetails().trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.taskDetails().trainingData().mode()); - Assertions.assertEquals("ac", model.taskDetails().trainingData().uri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java deleted file mode 100644 index 8d3ae3ca9647c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoMLVertical; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import org.junit.jupiter.api.Assertions; - -public final class AutoMLVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoMLVertical model = - BinaryData - .fromString( - "{\"taskType\":\"AutoMLVertical\",\"logVerbosity\":\"Critical\",\"targetColumnName\":\"eocnhzqrottj\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"yjzp\",\"description\":\"rl\"}}") - .toObject(AutoMLVertical.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("eocnhzqrottj", model.targetColumnName()); - Assertions.assertEquals("rl", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("yjzp", model.trainingData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoMLVertical model = - new AutoMLVertical() - .withLogVerbosity(LogVerbosity.CRITICAL) - .withTargetColumnName("eocnhzqrottj") - .withTrainingData( - new MLTableJobInput().withDescription("rl").withMode(InputDeliveryMode.DOWNLOAD).withUri("yjzp")); - model = BinaryData.fromObject(model).toObject(AutoMLVertical.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("eocnhzqrottj", model.targetColumnName()); - Assertions.assertEquals("rl", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("yjzp", model.trainingData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java deleted file mode 100644 index 58b47b826dc68..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoNCrossValidations; - -public final class AutoNCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoNCrossValidations.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoNCrossValidations model = new AutoNCrossValidations(); - model = BinaryData.fromObject(model).toObject(AutoNCrossValidations.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java deleted file mode 100644 index f12d789871f5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import org.junit.jupiter.api.Assertions; - -public final class AutoPausePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoPauseProperties model = - BinaryData - .fromString("{\"delayInMinutes\":1505052289,\"enabled\":true}") - .toObject(AutoPauseProperties.class); - Assertions.assertEquals(1505052289, model.delayInMinutes()); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoPauseProperties model = new AutoPauseProperties().withDelayInMinutes(1505052289).withEnabled(true); - model = BinaryData.fromObject(model).toObject(AutoPauseProperties.class); - Assertions.assertEquals(1505052289, model.delayInMinutes()); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java deleted file mode 100644 index c895c8da10433..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import org.junit.jupiter.api.Assertions; - -public final class AutoScalePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoScaleProperties model = - BinaryData - .fromString("{\"minNodeCount\":814110880,\"enabled\":true,\"maxNodeCount\":1557135644}") - .toObject(AutoScaleProperties.class); - Assertions.assertEquals(814110880, model.minNodeCount()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1557135644, model.maxNodeCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoScaleProperties model = - new AutoScaleProperties().withMinNodeCount(814110880).withEnabled(true).withMaxNodeCount(1557135644); - model = BinaryData.fromObject(model).toObject(AutoScaleProperties.class); - Assertions.assertEquals(814110880, model.minNodeCount()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1557135644, model.maxNodeCount()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java deleted file mode 100644 index e0e0e8665c433..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoSeasonality; - -public final class AutoSeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoSeasonality model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoSeasonality.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoSeasonality model = new AutoSeasonality(); - model = BinaryData.fromObject(model).toObject(AutoSeasonality.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java deleted file mode 100644 index 127caf51febf1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoTargetLags; - -public final class AutoTargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoTargetLags model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetLags.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoTargetLags model = new AutoTargetLags(); - model = BinaryData.fromObject(model).toObject(AutoTargetLags.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java deleted file mode 100644 index 14db2d76c61f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoTargetRollingWindowSize; - -public final class AutoTargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoTargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetRollingWindowSize.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoTargetRollingWindowSize model = new AutoTargetRollingWindowSize(); - model = BinaryData.fromObject(model).toObject(AutoTargetRollingWindowSize.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java deleted file mode 100644 index e2609437faf5e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BanditPolicy; -import org.junit.jupiter.api.Assertions; - -public final class BanditPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BanditPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"Bandit\",\"slackAmount\":59.648163,\"slackFactor\":43.063473,\"delayEvaluation\":364097944,\"evaluationInterval\":2114496472}") - .toObject(BanditPolicy.class); - Assertions.assertEquals(364097944, model.delayEvaluation()); - Assertions.assertEquals(2114496472, model.evaluationInterval()); - Assertions.assertEquals(59.648163F, model.slackAmount()); - Assertions.assertEquals(43.063473F, model.slackFactor()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BanditPolicy model = - new BanditPolicy() - .withDelayEvaluation(364097944) - .withEvaluationInterval(2114496472) - .withSlackAmount(59.648163F) - .withSlackFactor(43.063473F); - model = BinaryData.fromObject(model).toObject(BanditPolicy.class); - Assertions.assertEquals(364097944, model.delayEvaluation()); - Assertions.assertEquals(2114496472, model.evaluationInterval()); - Assertions.assertEquals(59.648163F, model.slackAmount()); - Assertions.assertEquals(43.063473F, model.slackFactor()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index d9c91dc82e167..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner; -import com.azure.resourcemanager.machinelearning.models.BatchDeploymentProperties; -import com.azure.resourcemanager.machinelearning.models.BatchDeploymentTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.BatchLoggingLevel; -import com.azure.resourcemanager.machinelearning.models.BatchOutputAction; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class BatchDeploymentTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"byuqerpqlp\",\"value\":[{\"identity\":{\"principalId\":\"439e0872-7c89-4299-a31c-cf73792200da\",\"tenantId\":\"50121c3a-c7ab-40c4-8c70-18840ec211b8\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"dbutauvfbtkuwhh\",\"properties\":{\"compute\":\"ykojoxafnndlpic\",\"errorThreshold\":171305753,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":1638328793,\"miniBatchSize\":8200965629156318432,\"outputAction\":\"AppendRow\",\"outputFileName\":\"pwdreqnovvqf\",\"provisioningState\":\"Failed\",\"description\":\"suwsyrsnds\",\"environmentId\":\"g\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"r\",\"tier\":\"Standard\",\"size\":\"neqn\",\"family\":\"rrwlquuijfqkace\",\"capacity\":2104888829},\"location\":\"fpubjibwwi\",\"tags\":{\"ynfs\":\"hqkvpuvksgplsak\",\"jphuopxodlqi\":\"n\",\"slyzrpzbchckqq\":\"ntorzihleosjswsr\",\"suiizynkedyat\":\"qioxi\"},\"id\":\"wyhqmibzyhwits\",\"name\":\"ypyynpcdpumnzg\",\"type\":\"wznm\"},{\"identity\":{\"principalId\":\"466a0824-8e60-480f-8923-8af40473b79f\",\"tenantId\":\"77aada0f-7267-4cb3-94d7-d6d969aaa174\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"rgjhxb\",\"properties\":{\"compute\":\"tlwwrlk\",\"errorThreshold\":1940246801,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":333571047,\"miniBatchSize\":4567104725520033936,\"outputAction\":\"SummaryOnly\",\"outputFileName\":\"yhgsy\",\"provisioningState\":\"Deleting\",\"description\":\"dtbnnha\",\"environmentId\":\"ocrkvcikh\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"mqg\",\"tier\":\"Basic\",\"size\":\"ezikywggxkal\",\"family\":\"tmelw\",\"capacity\":908050565},\"location\":\"ccjzkzivgvv\",\"tags\":{\"hyrnxxmu\":\"y\",\"v\":\"edndr\"},\"id\":\"tkwqqtchealm\",\"name\":\"mtdaa\",\"type\":\"gdv\"},{\"identity\":{\"principalId\":\"b3def810-702e-4b60-ab84-3e75ff2656f0\",\"tenantId\":\"241d1b0c-4837-448d-a75d-493d5be4541e\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"g\",\"properties\":{\"compute\":\"rtfudxepxg\",\"errorThreshold\":682770513,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":1825902686,\"miniBatchSize\":4744038705838577883,\"outputAction\":\"AppendRow\",\"outputFileName\":\"himdbl\",\"provisioningState\":\"Deleting\",\"description\":\"jhfjxwm\",\"environmentId\":\"kkfoqr\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"zi\",\"tier\":\"Basic\",\"size\":\"wneaiv\",\"family\":\"czelpcirel\",\"capacity\":561356651},\"location\":\"enwabfatk\",\"tags\":{\"oulpjrv\":\"xbjhwuaanozjosph\",\"rvimjwosytxitcsk\":\"ag\",\"hlyfjhdgqgg\":\"cktqumiekkezzi\",\"qfatpxllrxcyjm\":\"bdunygaeqid\"},\"id\":\"a\",\"name\":\"su\",\"type\":\"arm\"},{\"identity\":{\"principalId\":\"ecb5ec81-5f09-4997-928a-d4e055e4403a\",\"tenantId\":\"e364d12b-cbeb-400a-949f-4056df2528ce\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"q\",\"properties\":{\"compute\":\"hhyxxrw\",\"errorThreshold\":324291601,\"loggingLevel\":\"Info\",\"maxConcurrencyPerInstance\":381030924,\"miniBatchSize\":4370015191993628840,\"outputAction\":\"AppendRow\",\"outputFileName\":\"areqna\",\"provisioningState\":\"Succeeded\",\"description\":\"ky\",\"environmentId\":\"beddgssofw\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"alkrmn\",\"tier\":\"Basic\",\"size\":\"xacqqudfnbyx\",\"family\":\"aabjyvayffimrz\",\"capacity\":1007625802},\"location\":\"qogsexnevfd\",\"tags\":{\"euzsoi\":\"wmewzsyy\"},\"id\":\"judpfrxt\",\"name\":\"thzvaytdwkqbrqu\",\"type\":\"paxh\"}]}") - .toObject(BatchDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("byuqerpqlp", model.nextLink()); - Assertions.assertEquals("fpubjibwwi", model.value().get(0).location()); - Assertions.assertEquals("hqkvpuvksgplsak", model.value().get(0).tags().get("ynfs")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("dbutauvfbtkuwhh", model.value().get(0).kind()); - Assertions.assertEquals("suwsyrsnds", model.value().get(0).properties().description()); - Assertions.assertEquals("g", model.value().get(0).properties().environmentId()); - Assertions.assertEquals("ykojoxafnndlpic", model.value().get(0).properties().compute()); - Assertions.assertEquals(171305753, model.value().get(0).properties().errorThreshold()); - Assertions.assertEquals(BatchLoggingLevel.WARNING, model.value().get(0).properties().loggingLevel()); - Assertions.assertEquals(1638328793, model.value().get(0).properties().maxConcurrencyPerInstance()); - Assertions.assertEquals(8200965629156318432L, model.value().get(0).properties().miniBatchSize()); - Assertions.assertEquals(BatchOutputAction.APPEND_ROW, model.value().get(0).properties().outputAction()); - Assertions.assertEquals("pwdreqnovvqf", model.value().get(0).properties().outputFileName()); - Assertions.assertEquals("r", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("neqn", model.value().get(0).sku().size()); - Assertions.assertEquals("rrwlquuijfqkace", model.value().get(0).sku().family()); - Assertions.assertEquals(2104888829, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchDeploymentTrackedResourceArmPaginatedResult model = - new BatchDeploymentTrackedResourceArmPaginatedResult() - .withNextLink("byuqerpqlp") - .withValue( - Arrays - .asList( - new BatchDeploymentInner() - .withLocation("fpubjibwwi") - .withTags( - mapOf( - "ynfs", - "hqkvpuvksgplsak", - "jphuopxodlqi", - "n", - "slyzrpzbchckqq", - "ntorzihleosjswsr", - "suiizynkedyat", - "qioxi")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("dbutauvfbtkuwhh") - .withProperties( - new BatchDeploymentProperties() - .withDescription("suwsyrsnds") - .withEnvironmentId("g") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("ykojoxafnndlpic") - .withErrorThreshold(171305753) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(1638328793) - .withMiniBatchSize(8200965629156318432L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("pwdreqnovvqf")) - .withSku( - new Sku() - .withName("r") - .withTier(SkuTier.STANDARD) - .withSize("neqn") - .withFamily("rrwlquuijfqkace") - .withCapacity(2104888829)), - new BatchDeploymentInner() - .withLocation("ccjzkzivgvv") - .withTags(mapOf("hyrnxxmu", "y", "v", "edndr")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("rgjhxb") - .withProperties( - new BatchDeploymentProperties() - .withDescription("dtbnnha") - .withEnvironmentId("ocrkvcikh") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("tlwwrlk") - .withErrorThreshold(1940246801) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(333571047) - .withMiniBatchSize(4567104725520033936L) - .withOutputAction(BatchOutputAction.SUMMARY_ONLY) - .withOutputFileName("yhgsy")) - .withSku( - new Sku() - .withName("mqg") - .withTier(SkuTier.BASIC) - .withSize("ezikywggxkal") - .withFamily("tmelw") - .withCapacity(908050565)), - new BatchDeploymentInner() - .withLocation("enwabfatk") - .withTags( - mapOf( - "oulpjrv", - "xbjhwuaanozjosph", - "rvimjwosytxitcsk", - "ag", - "hlyfjhdgqgg", - "cktqumiekkezzi", - "qfatpxllrxcyjm", - "bdunygaeqid")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("g") - .withProperties( - new BatchDeploymentProperties() - .withDescription("jhfjxwm") - .withEnvironmentId("kkfoqr") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("rtfudxepxg") - .withErrorThreshold(682770513) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(1825902686) - .withMiniBatchSize(4744038705838577883L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("himdbl")) - .withSku( - new Sku() - .withName("zi") - .withTier(SkuTier.BASIC) - .withSize("wneaiv") - .withFamily("czelpcirel") - .withCapacity(561356651)), - new BatchDeploymentInner() - .withLocation("qogsexnevfd") - .withTags(mapOf("euzsoi", "wmewzsyy")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("q") - .withProperties( - new BatchDeploymentProperties() - .withDescription("ky") - .withEnvironmentId("beddgssofw") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("hhyxxrw") - .withErrorThreshold(324291601) - .withLoggingLevel(BatchLoggingLevel.INFO) - .withMaxConcurrencyPerInstance(381030924) - .withMiniBatchSize(4370015191993628840L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("areqna")) - .withSku( - new Sku() - .withName("alkrmn") - .withTier(SkuTier.BASIC) - .withSize("xacqqudfnbyx") - .withFamily("aabjyvayffimrz") - .withCapacity(1007625802)))); - model = BinaryData.fromObject(model).toObject(BatchDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("byuqerpqlp", model.nextLink()); - Assertions.assertEquals("fpubjibwwi", model.value().get(0).location()); - Assertions.assertEquals("hqkvpuvksgplsak", model.value().get(0).tags().get("ynfs")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("dbutauvfbtkuwhh", model.value().get(0).kind()); - Assertions.assertEquals("suwsyrsnds", model.value().get(0).properties().description()); - Assertions.assertEquals("g", model.value().get(0).properties().environmentId()); - Assertions.assertEquals("ykojoxafnndlpic", model.value().get(0).properties().compute()); - Assertions.assertEquals(171305753, model.value().get(0).properties().errorThreshold()); - Assertions.assertEquals(BatchLoggingLevel.WARNING, model.value().get(0).properties().loggingLevel()); - Assertions.assertEquals(1638328793, model.value().get(0).properties().maxConcurrencyPerInstance()); - Assertions.assertEquals(8200965629156318432L, model.value().get(0).properties().miniBatchSize()); - Assertions.assertEquals(BatchOutputAction.APPEND_ROW, model.value().get(0).properties().outputAction()); - Assertions.assertEquals("pwdreqnovvqf", model.value().get(0).properties().outputFileName()); - Assertions.assertEquals("r", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("neqn", model.value().get(0).sku().size()); - Assertions.assertEquals("rrwlquuijfqkace", model.value().get(0).sku().family()); - Assertions.assertEquals(2104888829, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java deleted file mode 100644 index 4a747598b2ef1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BatchDeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .batchDeployments() - .delete("ujdsooxrqwo", "urbti", "apdyarikeejdpdfh", "wmmkfq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java deleted file mode 100644 index 46d3c75933860..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointDefaults; -import org.junit.jupiter.api.Assertions; - -public final class BatchEndpointDefaultsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchEndpointDefaults model = - BinaryData.fromString("{\"deploymentName\":\"wsbpfvm\"}").toObject(BatchEndpointDefaults.class); - Assertions.assertEquals("wsbpfvm", model.deploymentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchEndpointDefaults model = new BatchEndpointDefaults().withDeploymentName("wsbpfvm"); - model = BinaryData.fromObject(model).toObject(BatchEndpointDefaults.class); - Assertions.assertEquals("wsbpfvm", model.deploymentName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index f8fc66942d42b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.BatchEndpointInner; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class BatchEndpointTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"gcj\",\"value\":[{\"identity\":{\"principalId\":\"f81557b3-3455-43a9-863a-877ebc9a8614\",\"tenantId\":\"ca2f438e-dabf-4a7a-808b-9b35946ac806\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"ttdumorppxebmnzb\",\"properties\":{\"provisioningState\":\"Canceled\",\"authMode\":\"Key\",\"description\":\"lkfg\",\"properties\":{},\"scoringUri\":\"euel\",\"swaggerUri\":\"hsd\"},\"sku\":{\"name\":\"t\",\"tier\":\"Standard\",\"size\":\"kd\",\"family\":\"wq\",\"capacity\":180318621},\"location\":\"zx\",\"tags\":{\"sg\":\"ithhqzon\",\"c\":\"b\"},\"id\":\"hfwdsjnkaljutiis\",\"name\":\"acffgdkzzewkfvhq\",\"type\":\"railvpnppfuf\"}]}") - .toObject(BatchEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("gcj", model.nextLink()); - Assertions.assertEquals("zx", model.value().get(0).location()); - Assertions.assertEquals("ithhqzon", model.value().get(0).tags().get("sg")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ttdumorppxebmnzb", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.KEY, model.value().get(0).properties().authMode()); - Assertions.assertEquals("lkfg", model.value().get(0).properties().description()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("kd", model.value().get(0).sku().size()); - Assertions.assertEquals("wq", model.value().get(0).sku().family()); - Assertions.assertEquals(180318621, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchEndpointTrackedResourceArmPaginatedResult model = - new BatchEndpointTrackedResourceArmPaginatedResult() - .withNextLink("gcj") - .withValue( - Arrays - .asList( - new BatchEndpointInner() - .withLocation("zx") - .withTags(mapOf("sg", "ithhqzon", "c", "b")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("ttdumorppxebmnzb") - .withProperties( - new BatchEndpointProperties() - .withAuthMode(EndpointAuthMode.KEY) - .withDescription("lkfg") - .withProperties(mapOf())) - .withSku( - new Sku() - .withName("t") - .withTier(SkuTier.STANDARD) - .withSize("kd") - .withFamily("wq") - .withCapacity(180318621)))); - model = BinaryData.fromObject(model).toObject(BatchEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("gcj", model.nextLink()); - Assertions.assertEquals("zx", model.value().get(0).location()); - Assertions.assertEquals("ithhqzon", model.value().get(0).tags().get("sg")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ttdumorppxebmnzb", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.KEY, model.value().get(0).properties().authMode()); - Assertions.assertEquals("lkfg", model.value().get(0).properties().description()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("kd", model.value().get(0).sku().size()); - Assertions.assertEquals("wq", model.value().get(0).sku().family()); - Assertions.assertEquals(180318621, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java deleted file mode 100644 index 6497981344837..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BatchEndpointsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.batchEndpoints().delete("pm", "rdlhvdvmiphbe", "eqjzm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java deleted file mode 100644 index 5828f1ca72ec1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BatchRetrySettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class BatchRetrySettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchRetrySettings model = - BinaryData - .fromString("{\"maxRetries\":80770684,\"timeout\":\"PT155H21M58S\"}") - .toObject(BatchRetrySettings.class); - Assertions.assertEquals(80770684, model.maxRetries()); - Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchRetrySettings model = - new BatchRetrySettings().withMaxRetries(80770684).withTimeout(Duration.parse("PT155H21M58S")); - model = BinaryData.fromObject(model).toObject(BatchRetrySettings.class); - Assertions.assertEquals(80770684, model.maxRetries()); - Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java deleted file mode 100644 index eff5b3a84ec34..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BayesianSamplingAlgorithm; - -public final class BayesianSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BayesianSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Bayesian\"}").toObject(BayesianSamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BayesianSamplingAlgorithm model = new BayesianSamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(BayesianSamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java deleted file mode 100644 index f45e52a1aad6a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import org.junit.jupiter.api.Assertions; - -public final class BuildContextTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BuildContext model = - BinaryData - .fromString("{\"contextUri\":\"mfpjbabw\",\"dockerfilePath\":\"fcxsspuunnoxy\"}") - .toObject(BuildContext.class); - Assertions.assertEquals("mfpjbabw", model.contextUri()); - Assertions.assertEquals("fcxsspuunnoxy", model.dockerfilePath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BuildContext model = new BuildContext().withContextUri("mfpjbabw").withDockerfilePath("fcxsspuunnoxy"); - model = BinaryData.fromObject(model).toObject(BuildContext.class); - Assertions.assertEquals("mfpjbabw", model.contextUri()); - Assertions.assertEquals("fcxsspuunnoxy", model.dockerfilePath()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java deleted file mode 100644 index 54361a6a37d24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.Classification; -import com.azure.resourcemanager.machinelearning.models.ClassificationModels; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.ClassificationTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Classification model = - BinaryData - .fromString( - "{\"taskType\":\"Classification\",\"positiveLabel\":\"z\",\"primaryMetric\":\"Accuracy\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"BernoulliNaiveBayes\",\"KNN\",\"LogisticRegression\",\"DecisionTree\"],\"blockedTrainingAlgorithms\":[\"SGD\",\"LightGBM\",\"SVM\"],\"enableDnnTraining\":true,\"enableModelExplainability\":true,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT239H29M50S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"dataclvdjjukyrdnqod\",\"stackMetaLearnerTrainPercentage\":30.06941234013376,\"stackMetaLearnerType\":\"LightGBMClassifier\"}},\"cvSplitColumnNames\":[\"aqnvzoqgyipemchg\",\"v\"],\"featurizationSettings\":{\"blockedTransformers\":[\"WoETargetEncoder\",\"WordEmbedding\",\"LabelEncoder\"],\"columnNameAndTypes\":{\"iuh\":\"ptlghwzhomewjjst\",\"ia\":\"awmo\",\"vodrrslblxydkxr\":\"cz\"},\"enableDnnFeaturization\":true,\"mode\":\"Off\",\"transformerParams\":{\"g\":[],\"qljnqkhychoco\":[],\"lehu\":[]},\"datasetLanguage\":\"lrqff\"},\"limitSettings\":{\"enableEarlyTermination\":false,\"exitScore\":50.27087572372039,\"maxConcurrentTrials\":450328402,\"maxCoresPerTrial\":1075829949,\"maxTrials\":662993818,\"timeout\":\"PT194H12M11S\",\"trialTimeout\":\"PT236H50M57S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"rxmrgchbapx\",\"description\":\"y\"},\"testDataSize\":1.7164995710023723,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"buscgduus\",\"description\":\"ycblevpmcl\"},\"validationDataSize\":38.79068857320828,\"weightColumnName\":\"yxlzgs\",\"logVerbosity\":\"Info\",\"targetColumnName\":\"zltafhbzffovwm\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"zqs\",\"description\":\"pgvdwnapfdqw\"}}") - .toObject(Classification.class); - Assertions.assertEquals(LogVerbosity.INFO, model.logVerbosity()); - Assertions.assertEquals("zltafhbzffovwm", model.targetColumnName()); - Assertions.assertEquals("pgvdwnapfdqw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("zqs", model.trainingData().uri()); - Assertions.assertEquals("z", model.positiveLabel()); - Assertions.assertEquals(ClassificationPrimaryMetrics.ACCURACY, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(true, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions - .assertEquals(Duration.parse("PT239H29M50S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 30.06941234013376D, model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.SGD, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("aqnvzoqgyipemchg", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("lrqff", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WO_ETARGET_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("ptlghwzhomewjjst", model.featurizationSettings().columnNameAndTypes().get("iuh")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.OFF, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(50.27087572372039D, model.limitSettings().exitScore()); - Assertions.assertEquals(450328402, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1075829949, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(662993818, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT194H12M11S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT236H50M57S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("y", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.testData().mode()); - Assertions.assertEquals("rxmrgchbapx", model.testData().uri()); - Assertions.assertEquals(1.7164995710023723D, model.testDataSize()); - Assertions.assertEquals("ycblevpmcl", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("buscgduus", model.validationData().uri()); - Assertions.assertEquals(38.79068857320828D, model.validationDataSize()); - Assertions.assertEquals("yxlzgs", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Classification model = - new Classification() - .withLogVerbosity(LogVerbosity.INFO) - .withTargetColumnName("zltafhbzffovwm") - .withTrainingData( - new MLTableJobInput() - .withDescription("pgvdwnapfdqw") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("zqs")) - .withPositiveLabel("z") - .withPrimaryMetric(ClassificationPrimaryMetrics.ACCURACY) - .withTrainingSettings( - new ClassificationTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(true) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT239H29M50S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("dataclvdjjukyrdnqod") - .withStackMetaLearnerTrainPercentage(30.06941234013376D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMCLASSIFIER)) - .withAllowedTrainingAlgorithms( - Arrays - .asList( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - ClassificationModels.KNN, - ClassificationModels.LOGISTIC_REGRESSION, - ClassificationModels.DECISION_TREE)) - .withBlockedTrainingAlgorithms( - Arrays - .asList( - ClassificationModels.SGD, - ClassificationModels.LIGHT_GBM, - ClassificationModels.SVM))) - .withCvSplitColumnNames(Arrays.asList("aqnvzoqgyipemchg", "v")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("lrqff") - .withBlockedTransformers( - Arrays - .asList( - BlockedTransformers.WO_ETARGET_ENCODER, - BlockedTransformers.WORD_EMBEDDING, - BlockedTransformers.LABEL_ENCODER)) - .withColumnNameAndTypes(mapOf("iuh", "ptlghwzhomewjjst", "ia", "awmo", "vodrrslblxydkxr", "cz")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.OFF) - .withTransformerParams( - mapOf("g", Arrays.asList(), "qljnqkhychoco", Arrays.asList(), "lehu", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(50.27087572372039D) - .withMaxConcurrentTrials(450328402) - .withMaxCoresPerTrial(1075829949) - .withMaxTrials(662993818) - .withTimeout(Duration.parse("PT194H12M11S")) - .withTrialTimeout(Duration.parse("PT236H50M57S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("y") - .withMode(InputDeliveryMode.DIRECT) - .withUri("rxmrgchbapx")) - .withTestDataSize(1.7164995710023723D) - .withValidationData( - new MLTableJobInput() - .withDescription("ycblevpmcl") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("buscgduus")) - .withValidationDataSize(38.79068857320828D) - .withWeightColumnName("yxlzgs"); - model = BinaryData.fromObject(model).toObject(Classification.class); - Assertions.assertEquals(LogVerbosity.INFO, model.logVerbosity()); - Assertions.assertEquals("zltafhbzffovwm", model.targetColumnName()); - Assertions.assertEquals("pgvdwnapfdqw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("zqs", model.trainingData().uri()); - Assertions.assertEquals("z", model.positiveLabel()); - Assertions.assertEquals(ClassificationPrimaryMetrics.ACCURACY, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(true, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions - .assertEquals(Duration.parse("PT239H29M50S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 30.06941234013376D, model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.SGD, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("aqnvzoqgyipemchg", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("lrqff", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WO_ETARGET_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("ptlghwzhomewjjst", model.featurizationSettings().columnNameAndTypes().get("iuh")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.OFF, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(50.27087572372039D, model.limitSettings().exitScore()); - Assertions.assertEquals(450328402, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1075829949, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(662993818, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT194H12M11S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT236H50M57S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("y", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.testData().mode()); - Assertions.assertEquals("rxmrgchbapx", model.testData().uri()); - Assertions.assertEquals(1.7164995710023723D, model.testDataSize()); - Assertions.assertEquals("ycblevpmcl", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("buscgduus", model.validationData().uri()); - Assertions.assertEquals(38.79068857320828D, model.validationDataSize()); - Assertions.assertEquals("yxlzgs", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java deleted file mode 100644 index 4cc81b1ca45ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationModels; -import com.azure.resourcemanager.machinelearning.models.ClassificationTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClassificationTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClassificationTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"LinearSVM\",\"KNN\"],\"blockedTrainingAlgorithms\":[\"LogisticRegression\"],\"enableDnnTraining\":false,\"enableModelExplainability\":true,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT171H27M12S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"dataeseyqr\",\"stackMetaLearnerTrainPercentage\":0.8015922020078059,\"stackMetaLearnerType\":\"LightGBMClassifier\"}}") - .toObject(ClassificationTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(true, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT171H27M12S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(0.8015922020078059D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ClassificationModels.LINEAR_SVM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.LOGISTIC_REGRESSION, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClassificationTrainingSettings model = - new ClassificationTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(true) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT171H27M12S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("dataeseyqr") - .withStackMetaLearnerTrainPercentage(0.8015922020078059D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMCLASSIFIER)) - .withAllowedTrainingAlgorithms(Arrays.asList(ClassificationModels.LINEAR_SVM, ClassificationModels.KNN)) - .withBlockedTrainingAlgorithms(Arrays.asList(ClassificationModels.LOGISTIC_REGRESSION)); - model = BinaryData.fromObject(model).toObject(ClassificationTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(true, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT171H27M12S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(0.8015922020078059D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ClassificationModels.LINEAR_SVM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.LOGISTIC_REGRESSION, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java deleted file mode 100644 index 34fb2ad4a38d5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClusterUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; - -public final class ClusterUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateParameters model = - BinaryData.fromString("{\"properties\":{\"properties\":{}}}").toObject(ClusterUpdateParameters.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateParameters model = new ClusterUpdateParameters().withProperties(new ScaleSettingsInformation()); - model = BinaryData.fromObject(model).toObject(ClusterUpdateParameters.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java deleted file mode 100644 index af927978ddd64..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ClusterUpdateProperties; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ClusterUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateProperties model = - BinaryData - .fromString( - "{\"properties\":{\"scaleSettings\":{\"maxNodeCount\":735455048,\"minNodeCount\":1281560612,\"nodeIdleTimeBeforeScaleDown\":\"PT89H36M53S\"}}}") - .toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(735455048, model.properties().scaleSettings().maxNodeCount()); - Assertions.assertEquals(1281560612, model.properties().scaleSettings().minNodeCount()); - Assertions - .assertEquals( - Duration.parse("PT89H36M53S"), model.properties().scaleSettings().nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateProperties model = - new ClusterUpdateProperties() - .withProperties( - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(735455048) - .withMinNodeCount(1281560612) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT89H36M53S")))); - model = BinaryData.fromObject(model).toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(735455048, model.properties().scaleSettings().maxNodeCount()); - Assertions.assertEquals(1281560612, model.properties().scaleSettings().minNodeCount()); - Assertions - .assertEquals( - Duration.parse("PT89H36M53S"), model.properties().scaleSettings().nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java deleted file mode 100644 index 45ffe83779de7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"zbhd\",\"nextVersion\":\"mlmz\",\"description\":\"oftrmaequia\",\"properties\":{\"nswhcc\":\"cslfaoqzpiyylha\",\"aivwitqscywu\":\"ph\"},\"tags\":{\"i\":\"oluhczbwemh\",\"wmsweypqwd\":\"sbrgz\",\"mkttlstvlzywem\":\"ggicccnxqhue\",\"lusiy\":\"zrncsdt\"}},\"id\":\"sfgytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}") - .toObject(CodeContainerInner.class); - Assertions.assertEquals("oftrmaequia", model.properties().description()); - Assertions.assertEquals("cslfaoqzpiyylha", model.properties().properties().get("nswhcc")); - Assertions.assertEquals("oluhczbwemh", model.properties().tags().get("i")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerInner model = - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("oftrmaequia") - .withProperties(mapOf("nswhcc", "cslfaoqzpiyylha", "aivwitqscywu", "ph")) - .withTags( - mapOf( - "i", - "oluhczbwemh", - "wmsweypqwd", - "sbrgz", - "mkttlstvlzywem", - "ggicccnxqhue", - "lusiy", - "zrncsdt")) - .withIsArchived(true)); - model = BinaryData.fromObject(model).toObject(CodeContainerInner.class); - Assertions.assertEquals("oftrmaequia", model.properties().description()); - Assertions.assertEquals("cslfaoqzpiyylha", model.properties().properties().get("nswhcc")); - Assertions.assertEquals("oluhczbwemh", model.properties().tags().get("i")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java deleted file mode 100644 index 18c6c8a71c1b4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":true,\"latestVersion\":\"p\",\"nextVersion\":\"ksrpqv\",\"description\":\"zraehtwd\",\"properties\":{\"cdl\":\"tswiby\",\"hfwpracstwit\":\"h\",\"nmdyodnwzxl\":\"khevxccedc\",\"nhltiugcxn\":\"jc\"},\"tags\":{\"nyowxwlmdjrkvfg\":\"wxqibyq\",\"j\":\"vfvpdbodaciz\",\"hvxndzwmkrefajpj\":\"lhkrribdeibqipqk\"}}") - .toObject(CodeContainerProperties.class); - Assertions.assertEquals("zraehtwd", model.description()); - Assertions.assertEquals("tswiby", model.properties().get("cdl")); - Assertions.assertEquals("wxqibyq", model.tags().get("nyowxwlmdjrkvfg")); - Assertions.assertEquals(true, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerProperties model = - new CodeContainerProperties() - .withDescription("zraehtwd") - .withProperties( - mapOf("cdl", "tswiby", "hfwpracstwit", "h", "nmdyodnwzxl", "khevxccedc", "nhltiugcxn", "jc")) - .withTags( - mapOf("nyowxwlmdjrkvfg", "wxqibyq", "j", "vfvpdbodaciz", "hvxndzwmkrefajpj", "lhkrribdeibqipqk")) - .withIsArchived(true); - model = BinaryData.fromObject(model).toObject(CodeContainerProperties.class); - Assertions.assertEquals("zraehtwd", model.description()); - Assertions.assertEquals("tswiby", model.properties().get("cdl")); - Assertions.assertEquals("wxqibyq", model.tags().get("nyowxwlmdjrkvfg")); - Assertions.assertEquals(true, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index 3178496ff08ee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import com.azure.resourcemanager.machinelearning.models.CodeContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"kojvd\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ouicybxarzgszu\",\"nextVersion\":\"x\",\"description\":\"q\",\"properties\":{},\"tags\":{}},\"id\":\"oamciodh\",\"name\":\"haz\",\"type\":\"khnzbonlw\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"gokdwbwhks\",\"nextVersion\":\"cmrvexzt\",\"description\":\"t\",\"properties\":{},\"tags\":{}},\"id\":\"ra\",\"name\":\"yzkoowtlmngu\",\"type\":\"aw\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"syuuximerq\",\"nextVersion\":\"bw\",\"description\":\"nkbykutwpfhp\",\"properties\":{},\"tags\":{}},\"id\":\"r\",\"name\":\"kdsnfdsdoakgtdl\",\"type\":\"kkze\"},{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ewpusdsttwvogvb\",\"nextVersion\":\"jdcngqqm\",\"description\":\"kufgmj\",\"properties\":{},\"tags\":{}},\"id\":\"dgrtwaenuuzkopbm\",\"name\":\"nrfdw\",\"type\":\"yuhhziu\"}]}") - .toObject(CodeContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("kojvd", model.nextLink()); - Assertions.assertEquals("q", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerResourceArmPaginatedResult model = - new CodeContainerResourceArmPaginatedResult() - .withNextLink("kojvd") - .withValue( - Arrays - .asList( - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("q") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("t") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("nkbykutwpfhp") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("kufgmj") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false)))); - model = BinaryData.fromObject(model).toObject(CodeContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("kojvd", model.nextLink()); - Assertions.assertEquals("q", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 2d055797b46df..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"bwfwhxorpwaltzwu\",\"nextVersion\":\"xojfcc\",\"description\":\"h\",\"properties\":{\"xcdrzprobzzxezm\":\"thvazjpw\",\"jeuxsphlo\":\"rkjg\",\"ufvcgnrgl\":\"fpmijpdvzvfbhwbd\"},\"tags\":{\"ebzx\":\"wyambhba\",\"qutibhl\":\"k\",\"bduxvzmlghnys\":\"nntrvrkps\",\"kppdi\":\"lpyeu\"}},\"id\":\"bo\",\"name\":\"xvhhyqq\",\"type\":\"gatxgrznmginmtsd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CodeContainer response = - manager - .codeContainers() - .define("xyauxre") - .withExistingWorkspace("wrswyiljp", "bkgx") - .withProperties( - new CodeContainerProperties() - .withDescription("gpwb") - .withProperties(mapOf("li", "ri")) - .withTags( - mapOf( - "bibticuhqvum", - "cgnwplrrbphcts", - "eqbbewfcuqfpy", - "pbfs", - "eyyjshcybwfuppox", - "xmzrmtmvwitu", - "iikmoxrezsvavlrx", - "rcmvouujx")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("h", response.properties().description()); - Assertions.assertEquals("thvazjpw", response.properties().properties().get("xcdrzprobzzxezm")); - Assertions.assertEquals("wyambhba", response.properties().tags().get("ebzx")); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 7a8d44abb0028..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .codeContainers() - .deleteWithResponse("hkigglclwalhvub", "gzphetxd", "cmyc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java deleted file mode 100644 index 3efd57df3af43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"x\",\"nextVersion\":\"fpzvoikvntwczf\",\"description\":\"ushlcxpblalh\",\"properties\":{\"kissaidqzsaa\":\"p\",\"fiafc\":\"qdsgptotxj\"},\"tags\":{\"cao\":\"tbfijz\"}},\"id\":\"olbuauktwieope\",\"name\":\"e\",\"type\":\"xq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CodeContainer response = - manager - .codeContainers() - .getWithResponse("ajqzj", "alec", "bibiwks", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ushlcxpblalh", response.properties().description()); - Assertions.assertEquals("p", response.properties().properties().get("kissaidqzsaa")); - Assertions.assertEquals("tbfijz", response.properties().tags().get("cao")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java deleted file mode 100644 index 303e81d6000f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"mazdfsqxh\",\"nextVersion\":\"mrejparnpvgr\",\"description\":\"rbwtdrcwgzwl\",\"properties\":{\"acfculzjrmhpf\":\"lhhfi\",\"xsoxi\":\"wvyldqpzf\"},\"tags\":{\"qqt\":\"jlzkdrocqsxy\"}},\"id\":\"iwdwisvnmeylajam\",\"name\":\"ajyhftpzc\",\"type\":\"ryklleynqa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.codeContainers().list("aluzyi", "fcvcewbwq", "dgsjsat", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rbwtdrcwgzwl", response.iterator().next().properties().description()); - Assertions.assertEquals("lhhfi", response.iterator().next().properties().properties().get("acfculzjrmhpf")); - Assertions.assertEquals("jlzkdrocqsxy", response.iterator().next().properties().tags().get("qqt")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 9cdca2627d869..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .codeVersions() - .deleteWithResponse("j", "xowkdnj", "xgkrh", "iehycpnowawonoe", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java deleted file mode 100644 index fc0822215bd47..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ColumnTransformer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ColumnTransformerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ColumnTransformer model = - BinaryData - .fromString("{\"fields\":[\"dsmjtgr\",\"gdgkki\"],\"parameters\":\"dataplkcsm\"}") - .toObject(ColumnTransformer.class); - Assertions.assertEquals("dsmjtgr", model.fields().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ColumnTransformer model = - new ColumnTransformer().withFields(Arrays.asList("dsmjtgr", "gdgkki")).withParameters("dataplkcsm"); - model = BinaryData.fromObject(model).toObject(ColumnTransformer.class); - Assertions.assertEquals("dsmjtgr", model.fields().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java deleted file mode 100644 index b51a96cea3340..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class CommandJobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommandJobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"Command\",\"timeout\":\"PT130H21M4S\"}") - .toObject(CommandJobLimits.class); - Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommandJobLimits model = new CommandJobLimits().withTimeout(Duration.parse("PT130H21M4S")); - model = BinaryData.fromObject(model).toObject(CommandJobLimits.class); - Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java deleted file mode 100644 index 179ff3923e2cb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"snjvcdwxlpqekftn\",\"nextVersion\":\"tjsyin\",\"description\":\"fq\",\"properties\":{\"ikdgszywkbir\":\"tdhtmdvyp\"},\"tags\":{\"hkjoqr\":\"zh\",\"mfiibfggj\":\"qqaatjinrvgou\",\"rwxkvtkkgl\":\"ool\"}},\"id\":\"wjygvjayvblmhvk\",\"name\":\"uhbxvvy\",\"type\":\"gsopbyrqufegxu\"}") - .toObject(ComponentContainerInner.class); - Assertions.assertEquals("fq", model.properties().description()); - Assertions.assertEquals("tdhtmdvyp", model.properties().properties().get("ikdgszywkbir")); - Assertions.assertEquals("zh", model.properties().tags().get("hkjoqr")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerInner model = - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("fq") - .withProperties(mapOf("ikdgszywkbir", "tdhtmdvyp")) - .withTags(mapOf("hkjoqr", "zh", "mfiibfggj", "qqaatjinrvgou", "rwxkvtkkgl", "ool")) - .withIsArchived(true)); - model = BinaryData.fromObject(model).toObject(ComponentContainerInner.class); - Assertions.assertEquals("fq", model.properties().description()); - Assertions.assertEquals("tdhtmdvyp", model.properties().properties().get("ikdgszywkbir")); - Assertions.assertEquals("zh", model.properties().tags().get("hkjoqr")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java deleted file mode 100644 index 7ac37197ded3a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"bnhlmc\",\"nextVersion\":\"p\",\"description\":\"gitvg\",\"properties\":{\"rh\":\"rixkwmyijejve\",\"xexccbdreaxhcexd\":\"pna\"},\"tags\":{\"yjsvfyc\":\"qahqkghtpwijn\",\"fvoow\":\"z\",\"pyostronzmyhgfi\":\"rvmtgjq\"}}") - .toObject(ComponentContainerProperties.class); - Assertions.assertEquals("gitvg", model.description()); - Assertions.assertEquals("rixkwmyijejve", model.properties().get("rh")); - Assertions.assertEquals("qahqkghtpwijn", model.tags().get("yjsvfyc")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerProperties model = - new ComponentContainerProperties() - .withDescription("gitvg") - .withProperties(mapOf("rh", "rixkwmyijejve", "xexccbdreaxhcexd", "pna")) - .withTags(mapOf("yjsvfyc", "qahqkghtpwijn", "fvoow", "z", "pyostronzmyhgfi", "rvmtgjq")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(ComponentContainerProperties.class); - Assertions.assertEquals("gitvg", model.description()); - Assertions.assertEquals("rixkwmyijejve", model.properties().get("rh")); - Assertions.assertEquals("qahqkghtpwijn", model.tags().get("yjsvfyc")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index e0932d12bdfa4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"ho\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"phqamvdkfwynwcvt\",\"nextVersion\":\"kayh\",\"description\":\"nvyq\",\"properties\":{},\"tags\":{}},\"id\":\"zwpcnpwzcjaesg\",\"name\":\"v\",\"type\":\"ccyajg\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"wygzlvdnkfxusem\",\"nextVersion\":\"zrmuhapfcqdps\",\"description\":\"qvpsvuoymg\",\"properties\":{},\"tags\":{}},\"id\":\"vezrypqlmfeo\",\"name\":\"erqwkyhkobopg\",\"type\":\"edkowepbqpcrfk\"}]}") - .toObject(ComponentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ho", model.nextLink()); - Assertions.assertEquals("nvyq", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerResourceArmPaginatedResult model = - new ComponentContainerResourceArmPaginatedResult() - .withNextLink("ho") - .withValue( - Arrays - .asList( - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("nvyq") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("qvpsvuoymg") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)))); - model = BinaryData.fromObject(model).toObject(ComponentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ho", model.nextLink()); - Assertions.assertEquals("nvyq", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index d358c3b29a3ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"bpbokhmml\",\"nextVersion\":\"yarnggcjfwblqhxk\",\"description\":\"mcolmu\",\"properties\":{\"kluwz\":\"vaos\",\"nobguqisqsqkpdmi\":\"eygzvtyevjhu\",\"pnml\":\"y\"},\"tags\":{\"yrx\":\"cpszpmcvqdvrdmv\",\"mbtple\":\"hgvqojbxaotcgbz\"}},\"id\":\"ioyidoxznvg\",\"name\":\"dtmuuvd\",\"type\":\"wsxmrszb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentContainer response = - manager - .componentContainers() - .define("wrdtnagzlgpy") - .withExistingWorkspace("avqdorbccqcd", "thojvlirknucos") - .withProperties( - new ComponentContainerProperties() - .withDescription("urgmcdcp") - .withProperties(mapOf("hyaaknyukibxiglh", "lojermhzicsbfd")) - .withTags(mapOf("tozyagjjnxkb", "wxqtejpiilh", "yxg", "lh", "cnvqeons", "fklvqzrwtrdg")) - .withIsArchived(true)) - .create(); - - Assertions.assertEquals("mcolmu", response.properties().description()); - Assertions.assertEquals("vaos", response.properties().properties().get("kluwz")); - Assertions.assertEquals("cpszpmcvqdvrdmv", response.properties().tags().get("yrx")); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 6996fbb163cc9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .componentContainers() - .deleteWithResponse( - "tpuwnnohmmzngocf", "juypwyiulaynosu", "kfhaxttpfsmwgsgh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java deleted file mode 100644 index e4b1837836cc8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"bzkuastaxklpr\",\"nextVersion\":\"l\",\"description\":\"l\",\"properties\":{\"yskye\":\"zwxvscksgf\",\"ckwrtw\":\"gafxczvf\"},\"tags\":{\"lhpdhwynctaczcnj\":\"yveszr\",\"x\":\"mbbfnv\",\"nkrtikl\":\"tzo\"}},\"id\":\"n\",\"name\":\"hql\",\"type\":\"oqksyiibhyxwbgbu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentContainer response = - manager - .componentContainers() - .getWithResponse("ucumlddauqml", "feothxu", "rigrjdljlkq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("l", response.properties().description()); - Assertions.assertEquals("zwxvscksgf", response.properties().properties().get("yskye")); - Assertions.assertEquals("yveszr", response.properties().tags().get("lhpdhwynctaczcnj")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java deleted file mode 100644 index 923a359e700ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ncgagdvc\",\"nextVersion\":\"hftzbpyfao\",\"description\":\"f\",\"properties\":{\"rf\":\"ncwmhjob\",\"dc\":\"ri\",\"f\":\"h\",\"oorssatfy\":\"cvbzwgwhgkgsoa\"},\"tags\":{\"dqn\":\"ufdmxuq\",\"fqayopbtsix\":\"sttuxv\",\"jay\":\"gvbhxmndztgs\"}},\"id\":\"arxneibpgbr\",\"name\":\"bjdqkn\",\"type\":\"qnm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .componentContainers() - .list("f", "uz", "wjecooyvhtuqbpe", ListViewType.ALL, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("f", response.iterator().next().properties().description()); - Assertions.assertEquals("ncwmhjob", response.iterator().next().properties().properties().get("rf")); - Assertions.assertEquals("ufdmxuq", response.iterator().next().properties().tags().get("dqn")); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java deleted file mode 100644 index b66999b281017..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"componentSpec\":\"datarnjwmw\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"zejjoqk\",\"properties\":{\"azpxdtnkdmkqjjl\":\"hsxttaugzxnf\",\"ou\":\"uenvrkp\",\"aays\":\"ibreb\"},\"tags\":{\"tezlwff\":\"xqtnq\",\"pqqmted\":\"iakp\"}},\"id\":\"mmji\",\"name\":\"yeozphvwauyqncy\",\"type\":\"upkvipmdsc\"}") - .toObject(ComponentVersionInner.class); - Assertions.assertEquals("zejjoqk", model.properties().description()); - Assertions.assertEquals("hsxttaugzxnf", model.properties().properties().get("azpxdtnkdmkqjjl")); - Assertions.assertEquals("xqtnq", model.properties().tags().get("tezlwff")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionInner model = - new ComponentVersionInner() - .withProperties( - new ComponentVersionProperties() - .withDescription("zejjoqk") - .withProperties(mapOf("azpxdtnkdmkqjjl", "hsxttaugzxnf", "ou", "uenvrkp", "aays", "ibreb")) - .withTags(mapOf("tezlwff", "xqtnq", "pqqmted", "iakp")) - .withIsAnonymous(true) - .withIsArchived(false) - .withComponentSpec("datarnjwmw")); - model = BinaryData.fromObject(model).toObject(ComponentVersionInner.class); - Assertions.assertEquals("zejjoqk", model.properties().description()); - Assertions.assertEquals("hsxttaugzxnf", model.properties().properties().get("azpxdtnkdmkqjjl")); - Assertions.assertEquals("xqtnq", model.properties().tags().get("tezlwff")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java deleted file mode 100644 index b9d87e131cd96..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionProperties model = - BinaryData - .fromString( - "{\"componentSpec\":\"dataqupevzh\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"hojujbypelmcuv\",\"properties\":{\"fw\":\"bjx\",\"coolsttpkiwkkb\":\"yl\",\"fpncurdo\":\"ujrywvtyl\",\"cbihwqk\":\"wiithtywub\"},\"tags\":{\"dgoihxumwctondzj\":\"ntwjch\",\"fdlwg\":\"uu\",\"gseinq\":\"ytsbwtovv\"}}") - .toObject(ComponentVersionProperties.class); - Assertions.assertEquals("hojujbypelmcuv", model.description()); - Assertions.assertEquals("bjx", model.properties().get("fw")); - Assertions.assertEquals("ntwjch", model.tags().get("dgoihxumwctondzj")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionProperties model = - new ComponentVersionProperties() - .withDescription("hojujbypelmcuv") - .withProperties( - mapOf("fw", "bjx", "coolsttpkiwkkb", "yl", "fpncurdo", "ujrywvtyl", "cbihwqk", "wiithtywub")) - .withTags(mapOf("dgoihxumwctondzj", "ntwjch", "fdlwg", "uu", "gseinq", "ytsbwtovv")) - .withIsAnonymous(true) - .withIsArchived(false) - .withComponentSpec("dataqupevzh"); - model = BinaryData.fromObject(model).toObject(ComponentVersionProperties.class); - Assertions.assertEquals("hojujbypelmcuv", model.description()); - Assertions.assertEquals("bjx", model.properties().get("fw")); - Assertions.assertEquals("ntwjch", model.tags().get("dgoihxumwctondzj")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index 7b0f86dc01c1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"sxkm\",\"value\":[{\"properties\":{\"componentSpec\":\"datakrrjrea\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"mhjglikkxwslolb\",\"properties\":{},\"tags\":{}},\"id\":\"zlmvfelfktgp\",\"name\":\"crpw\",\"type\":\"xeznoi\"}]}") - .toObject(ComponentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("sxkm", model.nextLink()); - Assertions.assertEquals("mhjglikkxwslolb", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionResourceArmPaginatedResult model = - new ComponentVersionResourceArmPaginatedResult() - .withNextLink("sxkm") - .withValue( - Arrays - .asList( - new ComponentVersionInner() - .withProperties( - new ComponentVersionProperties() - .withDescription("mhjglikkxwslolb") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(true) - .withComponentSpec("datakrrjrea")))); - model = BinaryData.fromObject(model).toObject(ComponentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("sxkm", model.nextLink()); - Assertions.assertEquals("mhjglikkxwslolb", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index f2df4fe9d91ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"componentSpec\":\"dataudpabcreuwzos\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"vasormrexzvdubew\",\"properties\":{\"ovsdqhzrtdbakrli\":\"gbaduve\",\"ifjmclngygnh\":\"zfvppkeq\"},\"tags\":{\"oqtrotpvclpo\":\"mbcdtajdopggorw\",\"xjgvh\":\"yrlmwkptsk\",\"ookbpu\":\"ccbmkakm\",\"kmlwkt\":\"mgvmuy\"}},\"id\":\"wzkroyrdurxfl\",\"name\":\"qjimejtgzjxxlfej\",\"type\":\"zuqloiwyayyzivr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentVersion response = - manager - .componentVersions() - .define("zkn") - .withExistingComponent("jzkcasfwzcntog", "fjwajnrt", "zvaqkifmxawost") - .withProperties( - new ComponentVersionProperties() - .withDescription("fnqqwyp") - .withProperties(mapOf("b", "r")) - .withTags(mapOf("wjfkainjmuym", "tggrss", "gmusaictdscnkzzo", "ecvztsc")) - .withIsAnonymous(false) - .withIsArchived(true) - .withComponentSpec("datakmjqncfvdsc")) - .create(); - - Assertions.assertEquals("vasormrexzvdubew", response.properties().description()); - Assertions.assertEquals("gbaduve", response.properties().properties().get("ovsdqhzrtdbakrli")); - Assertions.assertEquals("mbcdtajdopggorw", response.properties().tags().get("oqtrotpvclpo")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 2335daf835ca7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .componentVersions() - .deleteWithResponse( - "gdusxurs", "ivuxcjkcoqwczs", "iqrizfwihvaan", "qtnhjrfd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java deleted file mode 100644 index 35b5951185f6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"componentSpec\":\"datafkumcfjxoky\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"vfnkwmygjjekrk\",\"properties\":{\"rdtulcrcjdklotcs\":\"rugjqyckgtx\",\"zoonsv\":\"b\"},\"tags\":{\"nn\":\"hkxfpwhdyslbklgl\",\"xrid\":\"kwayqshwy\",\"aqjmkgxqwque\":\"tb\"}},\"id\":\"ylztp\",\"name\":\"iizevjykofvez\",\"type\":\"fkhkqtwqlep\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentVersion response = - manager - .componentVersions() - .getWithResponse( - "fdvbbaexxjfwtg", "fkkauigvmua", "mczfedyuepsvplt", "dajjvywe", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vfnkwmygjjekrk", response.properties().description()); - Assertions.assertEquals("rugjqyckgtx", response.properties().properties().get("rdtulcrcjdklotcs")); - Assertions.assertEquals("hkxfpwhdyslbklgl", response.properties().tags().get("nn")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java deleted file mode 100644 index ebfe28fbc2a34..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"componentSpec\":\"datask\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"ahzllrqmtlpb\",\"properties\":{\"noiicsu\":\"oiduyqypff\"},\"tags\":{\"oluqwgusxxhdo\":\"brjjtalxrdsjr\"}},\"id\":\"jwyblvtbdmvsb\",\"name\":\"idaelqpvekmkwjfb\",\"type\":\"tlo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .componentVersions() - .list( - "nimx", - "pnerxrzut", - "lcurzaqmnbx", - "aehtd", - 2095580918, - "mbnvynfaooeacted", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ahzllrqmtlpb", response.iterator().next().properties().description()); - Assertions.assertEquals("oiduyqypff", response.iterator().next().properties().properties().get("noiicsu")); - Assertions.assertEquals("brjjtalxrdsjr", response.iterator().next().properties().tags().get("oluqwgusxxhdo")); - Assertions.assertEquals(false, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java deleted file mode 100644 index 353ba419fa065..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceApplication; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceApplicationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceApplication model = - BinaryData - .fromString("{\"displayName\":\"cyychunsjlp\",\"endpointUri\":\"twszhvvuic\"}") - .toObject(ComputeInstanceApplication.class); - Assertions.assertEquals("cyychunsjlp", model.displayName()); - Assertions.assertEquals("twszhvvuic", model.endpointUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceApplication model = - new ComputeInstanceApplication().withDisplayName("cyychunsjlp").withEndpointUri("twszhvvuic"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceApplication.class); - Assertions.assertEquals("cyychunsjlp", model.displayName()); - Assertions.assertEquals("twszhvvuic", model.endpointUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java deleted file mode 100644 index e817919d853fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceConnectivityEndpoints; - -public final class ComputeInstanceConnectivityEndpointsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceConnectivityEndpoints model = - BinaryData - .fromString("{\"publicIpAddress\":\"vbrdfjmzsyzfho\",\"privateIpAddress\":\"h\"}") - .toObject(ComputeInstanceConnectivityEndpoints.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceConnectivityEndpoints model = new ComputeInstanceConnectivityEndpoints(); - model = BinaryData.fromObject(model).toObject(ComputeInstanceConnectivityEndpoints.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java deleted file mode 100644 index 7fdfda816fde6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Autosave; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceContainer; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceEnvironmentInfo; -import com.azure.resourcemanager.machinelearning.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceContainerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceContainer model = - BinaryData - .fromString( - "{\"name\":\"khvuhxepmrutz\",\"autosave\":\"Remote\",\"gpu\":\"obns\",\"network\":\"Host\",\"environment\":{\"name\":\"ltymkmvguihywart\",\"version\":\"phkixkykxdssjpe\"},\"services\":[\"datacfxhikkflrmy\"]}") - .toObject(ComputeInstanceContainer.class); - Assertions.assertEquals("khvuhxepmrutz", model.name()); - Assertions.assertEquals(Autosave.REMOTE, model.autosave()); - Assertions.assertEquals("obns", model.gpu()); - Assertions.assertEquals(Network.HOST, model.network()); - Assertions.assertEquals("ltymkmvguihywart", model.environment().name()); - Assertions.assertEquals("phkixkykxdssjpe", model.environment().version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceContainer model = - new ComputeInstanceContainer() - .withName("khvuhxepmrutz") - .withAutosave(Autosave.REMOTE) - .withGpu("obns") - .withNetwork(Network.HOST) - .withEnvironment( - new ComputeInstanceEnvironmentInfo().withName("ltymkmvguihywart").withVersion("phkixkykxdssjpe")); - model = BinaryData.fromObject(model).toObject(ComputeInstanceContainer.class); - Assertions.assertEquals("khvuhxepmrutz", model.name()); - Assertions.assertEquals(Autosave.REMOTE, model.autosave()); - Assertions.assertEquals("obns", model.gpu()); - Assertions.assertEquals(Network.HOST, model.network()); - Assertions.assertEquals("ltymkmvguihywart", model.environment().name()); - Assertions.assertEquals("phkixkykxdssjpe", model.environment().version()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java deleted file mode 100644 index bb0dc3aac424c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceCreatedBy; - -public final class ComputeInstanceCreatedByTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceCreatedBy model = - BinaryData - .fromString( - "{\"userName\":\"vtrrmhwrbfdpyflu\",\"userOrgId\":\"vjglrocuyzlwhhme\",\"userId\":\"ooclutnp\"}") - .toObject(ComputeInstanceCreatedBy.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceCreatedBy model = new ComputeInstanceCreatedBy(); - model = BinaryData.fromObject(model).toObject(ComputeInstanceCreatedBy.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java deleted file mode 100644 index e59e9c32edd91..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Caching; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataDisk; -import com.azure.resourcemanager.machinelearning.models.StorageAccountType; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceDataDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceDataDisk model = - BinaryData - .fromString( - "{\"caching\":\"ReadWrite\",\"diskSizeGB\":264674589,\"lun\":753182470,\"storageAccountType\":\"Premium_LRS\"}") - .toObject(ComputeInstanceDataDisk.class); - Assertions.assertEquals(Caching.READ_WRITE, model.caching()); - Assertions.assertEquals(264674589, model.diskSizeGB()); - Assertions.assertEquals(753182470, model.lun()); - Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceDataDisk model = - new ComputeInstanceDataDisk() - .withCaching(Caching.READ_WRITE) - .withDiskSizeGB(264674589) - .withLun(753182470) - .withStorageAccountType(StorageAccountType.PREMIUM_LRS); - model = BinaryData.fromObject(model).toObject(ComputeInstanceDataDisk.class); - Assertions.assertEquals(Caching.READ_WRITE, model.caching()); - Assertions.assertEquals(264674589, model.diskSizeGB()); - Assertions.assertEquals(753182470, model.lun()); - Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java deleted file mode 100644 index 5580c97a01ba0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataMount; -import com.azure.resourcemanager.machinelearning.models.MountAction; -import com.azure.resourcemanager.machinelearning.models.MountState; -import com.azure.resourcemanager.machinelearning.models.SourceType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceDataMountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceDataMount model = - BinaryData - .fromString( - "{\"source\":\"wlxte\",\"sourceType\":\"URI\",\"mountName\":\"jgwdtgukranbl\",\"mountAction\":\"Unmount\",\"createdBy\":\"lkccuzgygqwa\",\"mountPath\":\"iul\",\"mountState\":\"UnmountFailed\",\"mountedOn\":\"2021-09-27T01:24:26Z\",\"error\":\"rglvaw\"}") - .toObject(ComputeInstanceDataMount.class); - Assertions.assertEquals("wlxte", model.source()); - Assertions.assertEquals(SourceType.URI, model.sourceType()); - Assertions.assertEquals("jgwdtgukranbl", model.mountName()); - Assertions.assertEquals(MountAction.UNMOUNT, model.mountAction()); - Assertions.assertEquals("lkccuzgygqwa", model.createdBy()); - Assertions.assertEquals("iul", model.mountPath()); - Assertions.assertEquals(MountState.UNMOUNT_FAILED, model.mountState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T01:24:26Z"), model.mountedOn()); - Assertions.assertEquals("rglvaw", model.error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceDataMount model = - new ComputeInstanceDataMount() - .withSource("wlxte") - .withSourceType(SourceType.URI) - .withMountName("jgwdtgukranbl") - .withMountAction(MountAction.UNMOUNT) - .withCreatedBy("lkccuzgygqwa") - .withMountPath("iul") - .withMountState(MountState.UNMOUNT_FAILED) - .withMountedOn(OffsetDateTime.parse("2021-09-27T01:24:26Z")) - .withError("rglvaw"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceDataMount.class); - Assertions.assertEquals("wlxte", model.source()); - Assertions.assertEquals(SourceType.URI, model.sourceType()); - Assertions.assertEquals("jgwdtgukranbl", model.mountName()); - Assertions.assertEquals(MountAction.UNMOUNT, model.mountAction()); - Assertions.assertEquals("lkccuzgygqwa", model.createdBy()); - Assertions.assertEquals("iul", model.mountPath()); - Assertions.assertEquals(MountState.UNMOUNT_FAILED, model.mountState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T01:24:26Z"), model.mountedOn()); - Assertions.assertEquals("rglvaw", model.error()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java deleted file mode 100644 index 17390ecdc9f3a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceEnvironmentInfo; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceEnvironmentInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceEnvironmentInfo model = - BinaryData - .fromString("{\"name\":\"incqlhriswsl\",\"version\":\"iiovgqcgxu\"}") - .toObject(ComputeInstanceEnvironmentInfo.class); - Assertions.assertEquals("incqlhriswsl", model.name()); - Assertions.assertEquals("iiovgqcgxu", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceEnvironmentInfo model = - new ComputeInstanceEnvironmentInfo().withName("incqlhriswsl").withVersion("iiovgqcgxu"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceEnvironmentInfo.class); - Assertions.assertEquals("incqlhriswsl", model.name()); - Assertions.assertEquals("iiovgqcgxu", model.version()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java deleted file mode 100644 index 665d6aa9d183d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceLastOperation; -import com.azure.resourcemanager.machinelearning.models.OperationName; -import com.azure.resourcemanager.machinelearning.models.OperationStatus; -import com.azure.resourcemanager.machinelearning.models.OperationTrigger; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceLastOperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceLastOperation model = - BinaryData - .fromString( - "{\"operationName\":\"Reimage\",\"operationTime\":\"2021-10-12T06:41:45Z\",\"operationStatus\":\"InProgress\",\"operationTrigger\":\"IdleShutdown\"}") - .toObject(ComputeInstanceLastOperation.class); - Assertions.assertEquals(OperationName.REIMAGE, model.operationName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T06:41:45Z"), model.operationTime()); - Assertions.assertEquals(OperationStatus.IN_PROGRESS, model.operationStatus()); - Assertions.assertEquals(OperationTrigger.IDLE_SHUTDOWN, model.operationTrigger()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceLastOperation model = - new ComputeInstanceLastOperation() - .withOperationName(OperationName.REIMAGE) - .withOperationTime(OffsetDateTime.parse("2021-10-12T06:41:45Z")) - .withOperationStatus(OperationStatus.IN_PROGRESS) - .withOperationTrigger(OperationTrigger.IDLE_SHUTDOWN); - model = BinaryData.fromObject(model).toObject(ComputeInstanceLastOperation.class); - Assertions.assertEquals(OperationName.REIMAGE, model.operationName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T06:41:45Z"), model.operationTime()); - Assertions.assertEquals(OperationStatus.IN_PROGRESS, model.operationStatus()); - Assertions.assertEquals(OperationTrigger.IDLE_SHUTDOWN, model.operationTrigger()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java deleted file mode 100644 index 4e09a116f0b0f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceVersion; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceVersion model = - BinaryData.fromString("{\"runtime\":\"z\"}").toObject(ComputeInstanceVersion.class); - Assertions.assertEquals("z", model.runtime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceVersion model = new ComputeInstanceVersion().withRuntime("z"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceVersion.class); - Assertions.assertEquals("z", model.runtime()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java deleted file mode 100644 index 2e193135041f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComputeResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeResourceInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"7fba71ed-02a3-4dcb-81fc-4ba57769d9aa\",\"tenantId\":\"e70fe5bc-d75a-4541-bc8f-32e7904dcaaf\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"idokgjlj\":{\"principalId\":\"94a7d9af-e519-4c92-87c2-8418a856bc2c\",\"clientId\":\"29eb96fc-b273-4899-963f-bd7b5e463024\"}}},\"location\":\"xgvcl\",\"tags\":{\"bijhtxfvgxbf\":\"sncghkjeszz\",\"ec\":\"mxnehmp\",\"gr\":\"godebfqkkrbmpu\"},\"sku\":{\"name\":\"flz\",\"tier\":\"Standard\",\"size\":\"zpuzycisp\",\"family\":\"zahmgkbrpyydhibn\",\"capacity\":2043148337},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"kadrgvt\",\"provisioningState\":\"Unknown\",\"description\":\"buynhijggm\",\"createdOn\":\"2021-03-31T00:28:57Z\",\"modifiedOn\":\"2021-01-01T18:17:26Z\",\"resourceId\":\"rbu\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"zzmhjrunmpxttd\",\"name\":\"hrbnlankxmyskpbh\",\"type\":\"nbtkcxywnytnr\"}") - .toObject(ComputeResourceInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xgvcl", model.location()); - Assertions.assertEquals("sncghkjeszz", model.tags().get("bijhtxfvgxbf")); - Assertions.assertEquals("flz", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("zpuzycisp", model.sku().size()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.sku().family()); - Assertions.assertEquals(2043148337, model.sku().capacity()); - Assertions.assertEquals("kadrgvt", model.properties().computeLocation()); - Assertions.assertEquals("buynhijggm", model.properties().description()); - Assertions.assertEquals("rbu", model.properties().resourceId()); - Assertions.assertEquals(true, model.properties().disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeResourceInner model = - new ComputeResourceInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("idokgjlj", new UserAssignedIdentity()))) - .withLocation("xgvcl") - .withTags(mapOf("bijhtxfvgxbf", "sncghkjeszz", "ec", "mxnehmp", "gr", "godebfqkkrbmpu")) - .withSku( - new Sku() - .withName("flz") - .withTier(SkuTier.STANDARD) - .withSize("zpuzycisp") - .withFamily("zahmgkbrpyydhibn") - .withCapacity(2043148337)) - .withProperties( - new Compute() - .withComputeLocation("kadrgvt") - .withDescription("buynhijggm") - .withResourceId("rbu") - .withDisableLocalAuth(true)); - model = BinaryData.fromObject(model).toObject(ComputeResourceInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xgvcl", model.location()); - Assertions.assertEquals("sncghkjeszz", model.tags().get("bijhtxfvgxbf")); - Assertions.assertEquals("flz", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("zpuzycisp", model.sku().size()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.sku().family()); - Assertions.assertEquals(2043148337, model.sku().capacity()); - Assertions.assertEquals("kadrgvt", model.properties().computeLocation()); - Assertions.assertEquals("buynhijggm", model.properties().description()); - Assertions.assertEquals("rbu", model.properties().resourceId()); - Assertions.assertEquals(true, model.properties().disableLocalAuth()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java deleted file mode 100644 index ace304817ef71..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ComputeResourceSchema; -import org.junit.jupiter.api.Assertions; - -public final class ComputeResourceSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeResourceSchema model = - BinaryData - .fromString( - "{\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"lqidyby\",\"provisioningState\":\"Updating\",\"description\":\"clha\",\"createdOn\":\"2021-03-19T01:34:05Z\",\"modifiedOn\":\"2021-01-19T10:24:33Z\",\"resourceId\":\"p\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}}") - .toObject(ComputeResourceSchema.class); - Assertions.assertEquals("lqidyby", model.properties().computeLocation()); - Assertions.assertEquals("clha", model.properties().description()); - Assertions.assertEquals("p", model.properties().resourceId()); - Assertions.assertEquals(false, model.properties().disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeResourceSchema model = - new ComputeResourceSchema() - .withProperties( - new Compute() - .withComputeLocation("lqidyby") - .withDescription("clha") - .withResourceId("p") - .withDisableLocalAuth(false)); - model = BinaryData.fromObject(model).toObject(ComputeResourceSchema.class); - Assertions.assertEquals("lqidyby", model.properties().computeLocation()); - Assertions.assertEquals("clha", model.properties().description()); - Assertions.assertEquals("p", model.properties().resourceId()); - Assertions.assertEquals(false, model.properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java deleted file mode 100644 index 95463915c5068..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; -import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; -import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import com.azure.resourcemanager.machinelearning.models.TriggerType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ComputeSchedulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeSchedules model = - BinaryData - .fromString( - "{\"computeStartStop\":[{\"id\":\"lxrzvhqjwtr\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":1941330764,\"endTime\":\"w\",\"startTime\":\"jsmwrokc\",\"timeZone\":\"fzzzwyjafitlhg\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"nuchlgmltxdwhmo\",\"endTime\":\"sgzv\",\"startTime\":\"snnjzfpafolpym\",\"timeZone\":\"mxq\"},\"schedule\":{\"id\":\"gpgdphtvdulaj\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Enabled\"}},{\"id\":\"csrlzknmzl\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":794571898,\"endTime\":\"q\",\"startTime\":\"jhmqrhvthla\",\"timeZone\":\"dcxsmlz\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"zdtxetlgyd\",\"endTime\":\"qvlnnpxybafiqgea\",\"startTime\":\"bgj\",\"timeZone\":\"glklb\"},\"schedule\":{\"id\":\"idwcwvmzegjon\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Disabled\"}},{\"id\":\"gdn\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Stop\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Month\",\"interval\":1147399422,\"endTime\":\"sjcitdigsxc\",\"startTime\":\"l\",\"timeZone\":\"lkeuac\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"omflrytswfp\",\"endTime\":\"dgycxnmskwhqjjy\",\"startTime\":\"urlpshh\",\"timeZone\":\"pedwqsl\"},\"schedule\":{\"id\":\"mpqvwwsk\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}},{\"id\":\"wimuvqej\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Recurrence\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Week\",\"interval\":1658057009,\"endTime\":\"uqtljqobbpih\",\"startTime\":\"cecybmrqbrjbbmpx\",\"timeZone\":\"vykfrexcrse\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"jksghudg\",\"endTime\":\"xog\",\"startTime\":\"gsv\",\"timeZone\":\"jkxibda\"},\"schedule\":{\"id\":\"kmdyomkxfbvfbh\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}}]}") - .toObject(ComputeSchedules.class); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.computeStartStop().get(0).status()); - Assertions.assertEquals(ComputePowerAction.START, model.computeStartStop().get(0).action()); - Assertions.assertEquals(TriggerType.CRON, model.computeStartStop().get(0).triggerType()); - Assertions.assertEquals("w", model.computeStartStop().get(0).recurrence().endTime()); - Assertions.assertEquals("jsmwrokc", model.computeStartStop().get(0).recurrence().startTime()); - Assertions.assertEquals("fzzzwyjafitlhg", model.computeStartStop().get(0).recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.computeStartStop().get(0).recurrence().frequency()); - Assertions.assertEquals(1941330764, model.computeStartStop().get(0).recurrence().interval()); - Assertions.assertEquals("sgzv", model.computeStartStop().get(0).cron().endTime()); - Assertions.assertEquals("snnjzfpafolpym", model.computeStartStop().get(0).cron().startTime()); - Assertions.assertEquals("mxq", model.computeStartStop().get(0).cron().timeZone()); - Assertions.assertEquals("nuchlgmltxdwhmo", model.computeStartStop().get(0).cron().expression()); - Assertions.assertEquals("gpgdphtvdulaj", model.computeStartStop().get(0).schedule().id()); - Assertions - .assertEquals( - ScheduleProvisioningState.PROVISIONING, - model.computeStartStop().get(0).schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.computeStartStop().get(0).schedule().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeSchedules model = - new ComputeSchedules() - .withComputeStartStop( - Arrays - .asList( - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("w") - .withStartTime("jsmwrokc") - .withTimeZone("fzzzwyjafitlhg") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(1941330764)) - .withCron( - new CronTrigger() - .withEndTime("sgzv") - .withStartTime("snnjzfpafolpym") - .withTimeZone("mxq") - .withExpression("nuchlgmltxdwhmo")) - .withSchedule( - new ScheduleBase() - .withId("gpgdphtvdulaj") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.ENABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("q") - .withStartTime("jhmqrhvthla") - .withTimeZone("dcxsmlz") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(794571898)) - .withCron( - new CronTrigger() - .withEndTime("qvlnnpxybafiqgea") - .withStartTime("bgj") - .withTimeZone("glklb") - .withExpression("zdtxetlgyd")) - .withSchedule( - new ScheduleBase() - .withId("idwcwvmzegjon") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.DISABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.STOP) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("sjcitdigsxc") - .withStartTime("l") - .withTimeZone("lkeuac") - .withFrequency(RecurrenceFrequency.MONTH) - .withInterval(1147399422)) - .withCron( - new CronTrigger() - .withEndTime("dgycxnmskwhqjjy") - .withStartTime("urlpshh") - .withTimeZone("pedwqsl") - .withExpression("omflrytswfp")) - .withSchedule( - new ScheduleBase() - .withId("mpqvwwsk") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.RECURRENCE) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("uqtljqobbpih") - .withStartTime("cecybmrqbrjbbmpx") - .withTimeZone("vykfrexcrse") - .withFrequency(RecurrenceFrequency.WEEK) - .withInterval(1658057009)) - .withCron( - new CronTrigger() - .withEndTime("xog") - .withStartTime("gsv") - .withTimeZone("jkxibda") - .withExpression("jksghudg")) - .withSchedule( - new ScheduleBase() - .withId("kmdyomkxfbvfbh") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED)))); - model = BinaryData.fromObject(model).toObject(ComputeSchedules.class); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.computeStartStop().get(0).status()); - Assertions.assertEquals(ComputePowerAction.START, model.computeStartStop().get(0).action()); - Assertions.assertEquals(TriggerType.CRON, model.computeStartStop().get(0).triggerType()); - Assertions.assertEquals("w", model.computeStartStop().get(0).recurrence().endTime()); - Assertions.assertEquals("jsmwrokc", model.computeStartStop().get(0).recurrence().startTime()); - Assertions.assertEquals("fzzzwyjafitlhg", model.computeStartStop().get(0).recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.computeStartStop().get(0).recurrence().frequency()); - Assertions.assertEquals(1941330764, model.computeStartStop().get(0).recurrence().interval()); - Assertions.assertEquals("sgzv", model.computeStartStop().get(0).cron().endTime()); - Assertions.assertEquals("snnjzfpafolpym", model.computeStartStop().get(0).cron().startTime()); - Assertions.assertEquals("mxq", model.computeStartStop().get(0).cron().timeZone()); - Assertions.assertEquals("nuchlgmltxdwhmo", model.computeStartStop().get(0).cron().expression()); - Assertions.assertEquals("gpgdphtvdulaj", model.computeStartStop().get(0).schedule().id()); - Assertions - .assertEquals( - ScheduleProvisioningState.PROVISIONING, - model.computeStartStop().get(0).schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.computeStartStop().get(0).schedule().status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java deleted file mode 100644 index d0d7dd931e676..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; - -public final class ComputeSecretsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeSecretsInner model = - BinaryData.fromString("{\"computeType\":\"ComputeSecrets\"}").toObject(ComputeSecretsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeSecretsInner model = new ComputeSecretsInner(); - model = BinaryData.fromObject(model).toObject(ComputeSecretsInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java deleted file mode 100644 index 422af5e5d26e0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; -import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import com.azure.resourcemanager.machinelearning.models.TriggerType; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ComputeStartStopScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeStartStopSchedule model = - BinaryData - .fromString( - "{\"id\":\"wpg\",\"provisioningStatus\":\"Failed\",\"status\":\"Enabled\",\"action\":\"Start\",\"triggerType\":\"Recurrence\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Day\",\"interval\":926595396,\"schedule\":{\"hours\":[1582308433],\"minutes\":[166613008],\"monthDays\":[587867611,1327364121],\"weekDays\":[\"Thursday\"]},\"endTime\":\"bwsnsqow\",\"startTime\":\"comlikytwvczc\",\"timeZone\":\"k\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"ve\",\"endTime\":\"fdv\",\"startTime\":\"hbwrnfxtgddpqth\",\"timeZone\":\"n\"},\"schedule\":{\"id\":\"oya\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Disabled\"}}") - .toObject(ComputeStartStopSchedule.class); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.status()); - Assertions.assertEquals(ComputePowerAction.START, model.action()); - Assertions.assertEquals(TriggerType.RECURRENCE, model.triggerType()); - Assertions.assertEquals("bwsnsqow", model.recurrence().endTime()); - Assertions.assertEquals("comlikytwvczc", model.recurrence().startTime()); - Assertions.assertEquals("k", model.recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.DAY, model.recurrence().frequency()); - Assertions.assertEquals(926595396, model.recurrence().interval()); - Assertions.assertEquals(1582308433, model.recurrence().schedule().hours().get(0)); - Assertions.assertEquals(166613008, model.recurrence().schedule().minutes().get(0)); - Assertions.assertEquals(587867611, model.recurrence().schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.THURSDAY, model.recurrence().schedule().weekDays().get(0)); - Assertions.assertEquals("fdv", model.cron().endTime()); - Assertions.assertEquals("hbwrnfxtgddpqth", model.cron().startTime()); - Assertions.assertEquals("n", model.cron().timeZone()); - Assertions.assertEquals("ve", model.cron().expression()); - Assertions.assertEquals("oya", model.schedule().id()); - Assertions.assertEquals(ScheduleProvisioningState.PROVISIONING, model.schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.schedule().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeStartStopSchedule model = - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.ENABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.RECURRENCE) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("bwsnsqow") - .withStartTime("comlikytwvczc") - .withTimeZone("k") - .withFrequency(RecurrenceFrequency.DAY) - .withInterval(926595396) - .withSchedule( - new RecurrenceSchedule() - .withHours(Arrays.asList(1582308433)) - .withMinutes(Arrays.asList(166613008)) - .withMonthDays(Arrays.asList(587867611, 1327364121)) - .withWeekDays(Arrays.asList(WeekDay.THURSDAY)))) - .withCron( - new CronTrigger() - .withEndTime("fdv") - .withStartTime("hbwrnfxtgddpqth") - .withTimeZone("n") - .withExpression("ve")) - .withSchedule( - new ScheduleBase() - .withId("oya") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.DISABLED)); - model = BinaryData.fromObject(model).toObject(ComputeStartStopSchedule.class); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.status()); - Assertions.assertEquals(ComputePowerAction.START, model.action()); - Assertions.assertEquals(TriggerType.RECURRENCE, model.triggerType()); - Assertions.assertEquals("bwsnsqow", model.recurrence().endTime()); - Assertions.assertEquals("comlikytwvczc", model.recurrence().startTime()); - Assertions.assertEquals("k", model.recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.DAY, model.recurrence().frequency()); - Assertions.assertEquals(926595396, model.recurrence().interval()); - Assertions.assertEquals(1582308433, model.recurrence().schedule().hours().get(0)); - Assertions.assertEquals(166613008, model.recurrence().schedule().minutes().get(0)); - Assertions.assertEquals(587867611, model.recurrence().schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.THURSDAY, model.recurrence().schedule().weekDays().get(0)); - Assertions.assertEquals("fdv", model.cron().endTime()); - Assertions.assertEquals("hbwrnfxtgddpqth", model.cron().startTime()); - Assertions.assertEquals("n", model.cron().timeZone()); - Assertions.assertEquals("ve", model.cron().expression()); - Assertions.assertEquals("oya", model.schedule().id()); - Assertions.assertEquals(ScheduleProvisioningState.PROVISIONING, model.schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.schedule().status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java deleted file mode 100644 index 6d5820af19793..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Compute; -import org.junit.jupiter.api.Assertions; - -public final class ComputeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Compute model = - BinaryData - .fromString( - "{\"computeType\":\"Compute\",\"computeLocation\":\"tsthsucocm\",\"provisioningState\":\"Canceled\",\"description\":\"zt\",\"createdOn\":\"2021-04-09T08:14:29Z\",\"modifiedOn\":\"2021-08-28T10:19:16Z\",\"resourceId\":\"qpuedckzywbiex\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false}") - .toObject(Compute.class); - Assertions.assertEquals("tsthsucocm", model.computeLocation()); - Assertions.assertEquals("zt", model.description()); - Assertions.assertEquals("qpuedckzywbiex", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Compute model = - new Compute() - .withComputeLocation("tsthsucocm") - .withDescription("zt") - .withResourceId("qpuedckzywbiex") - .withDisableLocalAuth(false); - model = BinaryData.fromObject(model).toObject(Compute.class); - Assertions.assertEquals("tsthsucocm", model.computeLocation()); - Assertions.assertEquals("zt", model.description()); - Assertions.assertEquals("qpuedckzywbiex", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java deleted file mode 100644 index 34735a5e7776c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"1ee3bee0-6ff7-49e8-bb68-e00d27bcece0\",\"tenantId\":\"5cc048d8-79ef-4872-886f-a002e40a7489\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"nii\",\"tags\":{\"sjtgirnbgmgmddo\":\"vqban\"},\"sku\":{\"name\":\"mynltwmpftmfoeaj\",\"tier\":\"Standard\",\"size\":\"xwet\",\"family\":\"fddrvlkpzwbhnrec\",\"capacity\":252329651},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"muhkahm\",\"provisioningState\":\"Succeeded\",\"description\":\"iuc\",\"createdOn\":\"2021-02-05T06:18:58Z\",\"modifiedOn\":\"2021-09-23T11:37:53Z\",\"resourceId\":\"jpjbweunxcqr\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false},\"id\":\"hppiybx\",\"name\":\"gnzuzpbgkzcsc\",\"type\":\"iuzvkunhdimju\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeResource response = - manager - .computes() - .define("ojxrjnbsconxavi") - .withExistingWorkspace("mdafbgymqt", "apr") - .withRegion("izqfsgnwdxz") - .withTags(mapOf("rfbo", "q")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withSku( - new Sku() - .withName("ipmlnfyzavf") - .withTier(SkuTier.FREE) - .withSize("icdbkpdj") - .withFamily("qh") - .withCapacity(222903277)) - .withProperties( - new Compute() - .withComputeLocation("dgonjhxshthmgp") - .withDescription("lptkbvc") - .withResourceId("gqqbtimpk") - .withDisableLocalAuth(false)) - .create(); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("nii", response.location()); - Assertions.assertEquals("vqban", response.tags().get("sjtgirnbgmgmddo")); - Assertions.assertEquals("mynltwmpftmfoeaj", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("xwet", response.sku().size()); - Assertions.assertEquals("fddrvlkpzwbhnrec", response.sku().family()); - Assertions.assertEquals(252329651, response.sku().capacity()); - Assertions.assertEquals("muhkahm", response.properties().computeLocation()); - Assertions.assertEquals("iuc", response.properties().description()); - Assertions.assertEquals("jpjbweunxcqr", response.properties().resourceId()); - Assertions.assertEquals(false, response.properties().disableLocalAuth()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java deleted file mode 100644 index 08eeb0e3f5775..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .computes() - .delete( - "tlqh", "pxouvmr", "iflikyypzkgxfx", UnderlyingResourceAction.DETACH, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java deleted file mode 100644 index ed6becf3e9e77..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"1de443a3-f608-425f-91bd-438d47ec26d7\",\"tenantId\":\"e37f22c1-6b70-4a8c-8d5a-d0815df251d2\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"kgd\",\"tags\":{\"qsktxqf\":\"krukizyhgsqt\",\"cgbfzuscstun\":\"jbqggweeiwdhdm\",\"bkl\":\"lhxd\",\"f\":\"iichgjsysmvxodgw\"},\"sku\":{\"name\":\"sifcuvbdujgc\",\"tier\":\"Free\",\"size\":\"cbbwjtrdxriz\",\"family\":\"bbgiarksykpgdqxw\",\"capacity\":230334707},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"qrxhaclcdos\",\"provisioningState\":\"Creating\",\"description\":\"jqgkifmmainwhe\",\"createdOn\":\"2021-07-02T12:23:07Z\",\"modifiedOn\":\"2021-11-29T01:34:21Z\",\"resourceId\":\"wuntobuiz\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"vydjufbnk\",\"name\":\"blaxpegj\",\"type\":\"dabalfdxaglzfytl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeResource response = - manager - .computes() - .getWithResponse("xampqcr", "g", "uqxbpiatwfauje", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals("kgd", response.location()); - Assertions.assertEquals("krukizyhgsqt", response.tags().get("qsktxqf")); - Assertions.assertEquals("sifcuvbdujgc", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("cbbwjtrdxriz", response.sku().size()); - Assertions.assertEquals("bbgiarksykpgdqxw", response.sku().family()); - Assertions.assertEquals(230334707, response.sku().capacity()); - Assertions.assertEquals("qrxhaclcdos", response.properties().computeLocation()); - Assertions.assertEquals("jqgkifmmainwhe", response.properties().description()); - Assertions.assertEquals("wuntobuiz", response.properties().resourceId()); - Assertions.assertEquals(true, response.properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java deleted file mode 100644 index cdf7973f94365..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListKeysWithResponseMockTests { - @Test - public void testListKeysWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"computeType\":\"ComputeSecrets\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeSecrets response = - manager - .computes() - .listKeysWithResponse("lilw", "ghjhjvmabzzbwa", "b", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java deleted file mode 100644 index 31b5b2dd45c8c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"principalId\":\"0be36eb6-1866-4b48-9c68-496f7e78e9dd\",\"tenantId\":\"3db7bdd0-a243-4495-af5a-9360ec87f65c\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"ujmoi\",\"tags\":{\"jslkyozdsfzjue\":\"wemhdee\",\"jtv\":\"rhrhtsl\",\"xvgjbfi\":\"j\",\"bj\":\"bpnjodf\"},\"sku\":{\"name\":\"wmtqsmoxsaz\",\"tier\":\"Basic\",\"size\":\"gwecywnfysz\",\"family\":\"czs\",\"capacity\":57372147},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"ddbboz\",\"provisioningState\":\"Deleting\",\"description\":\"mkjmyitrchwudlxe\",\"createdOn\":\"2021-07-21T06:48:48Z\",\"modifiedOn\":\"2021-01-08T01:59:39Z\",\"resourceId\":\"noejhqlfmsibz\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"ydpmypgfqvmt\",\"name\":\"whlakxpejpew\",\"type\":\"yjl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.computes().list("zb", "yqjoghdsa", "djanormo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("ujmoi", response.iterator().next().location()); - Assertions.assertEquals("wemhdee", response.iterator().next().tags().get("jslkyozdsfzjue")); - Assertions.assertEquals("wmtqsmoxsaz", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("gwecywnfysz", response.iterator().next().sku().size()); - Assertions.assertEquals("czs", response.iterator().next().sku().family()); - Assertions.assertEquals(57372147, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ddbboz", response.iterator().next().properties().computeLocation()); - Assertions.assertEquals("mkjmyitrchwudlxe", response.iterator().next().properties().description()); - Assertions.assertEquals("noejhqlfmsibz", response.iterator().next().properties().resourceId()); - Assertions.assertEquals(true, response.iterator().next().properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java deleted file mode 100644 index 72ba2b3c739f9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListNodesMockTests { - @Test - public void testListNodes() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nodes\":[{\"nodeId\":\"skw\",\"privateIpAddress\":\"sdetjygowifcqpol\",\"publicIpAddress\":\"gysdgzyyb\",\"port\":375628920,\"nodeState\":\"running\",\"runId\":\"cptvdxxheig\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.computes().listNodes("yrqsdbpokszanm", "wgpterdiuw", "i", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java deleted file mode 100644 index 1f0d2cfe906e1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; - -public final class ContainerResourceRequirementsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerResourceRequirements model = - BinaryData - .fromString( - "{\"containerResourceLimits\":{\"cpu\":\"wllcolsr\",\"gpu\":\"apte\",\"memory\":\"excgjokjljnhvl\"},\"containerResourceRequests\":{\"cpu\":\"ek\",\"gpu\":\"eksnbksdqhjvyk\",\"memory\":\"eslk\"}}") - .toObject(ContainerResourceRequirements.class); - Assertions.assertEquals("wllcolsr", model.containerResourceLimits().cpu()); - Assertions.assertEquals("apte", model.containerResourceLimits().gpu()); - Assertions.assertEquals("excgjokjljnhvl", model.containerResourceLimits().memory()); - Assertions.assertEquals("ek", model.containerResourceRequests().cpu()); - Assertions.assertEquals("eksnbksdqhjvyk", model.containerResourceRequests().gpu()); - Assertions.assertEquals("eslk", model.containerResourceRequests().memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerResourceRequirements model = - new ContainerResourceRequirements() - .withContainerResourceLimits( - new ContainerResourceSettings().withCpu("wllcolsr").withGpu("apte").withMemory("excgjokjljnhvl")) - .withContainerResourceRequests( - new ContainerResourceSettings().withCpu("ek").withGpu("eksnbksdqhjvyk").withMemory("eslk")); - model = BinaryData.fromObject(model).toObject(ContainerResourceRequirements.class); - Assertions.assertEquals("wllcolsr", model.containerResourceLimits().cpu()); - Assertions.assertEquals("apte", model.containerResourceLimits().gpu()); - Assertions.assertEquals("excgjokjljnhvl", model.containerResourceLimits().memory()); - Assertions.assertEquals("ek", model.containerResourceRequests().cpu()); - Assertions.assertEquals("eksnbksdqhjvyk", model.containerResourceRequests().gpu()); - Assertions.assertEquals("eslk", model.containerResourceRequests().memory()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java deleted file mode 100644 index 430c11d570d60..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; - -public final class ContainerResourceSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerResourceSettings model = - BinaryData - .fromString("{\"cpu\":\"ustcpoq\",\"gpu\":\"vnwqjwgo\",\"memory\":\"lejjjkxy\"}") - .toObject(ContainerResourceSettings.class); - Assertions.assertEquals("ustcpoq", model.cpu()); - Assertions.assertEquals("vnwqjwgo", model.gpu()); - Assertions.assertEquals("lejjjkxy", model.memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerResourceSettings model = - new ContainerResourceSettings().withCpu("ustcpoq").withGpu("vnwqjwgo").withMemory("lejjjkxy"); - model = BinaryData.fromObject(model).toObject(ContainerResourceSettings.class); - Assertions.assertEquals("ustcpoq", model.cpu()); - Assertions.assertEquals("vnwqjwgo", model.gpu()); - Assertions.assertEquals("lejjjkxy", model.memory()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java deleted file mode 100644 index eb119224d22af..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import org.junit.jupiter.api.Assertions; - -public final class CosmosDbSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CosmosDbSettings model = - BinaryData.fromString("{\"collectionsThroughput\":1098993569}").toObject(CosmosDbSettings.class); - Assertions.assertEquals(1098993569, model.collectionsThroughput()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CosmosDbSettings model = new CosmosDbSettings().withCollectionsThroughput(1098993569); - model = BinaryData.fromObject(model).toObject(CosmosDbSettings.class); - Assertions.assertEquals(1098993569, model.collectionsThroughput()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java deleted file mode 100644 index 946de8b11fecc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import org.junit.jupiter.api.Assertions; - -public final class CronTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CronTrigger model = - BinaryData - .fromString( - "{\"triggerType\":\"Cron\",\"expression\":\"ksrl\",\"endTime\":\"desqplpvmjcdo\",\"startTime\":\"bidyv\",\"timeZone\":\"owx\"}") - .toObject(CronTrigger.class); - Assertions.assertEquals("desqplpvmjcdo", model.endTime()); - Assertions.assertEquals("bidyv", model.startTime()); - Assertions.assertEquals("owx", model.timeZone()); - Assertions.assertEquals("ksrl", model.expression()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CronTrigger model = - new CronTrigger() - .withEndTime("desqplpvmjcdo") - .withStartTime("bidyv") - .withTimeZone("owx") - .withExpression("ksrl"); - model = BinaryData.fromObject(model).toObject(CronTrigger.class); - Assertions.assertEquals("desqplpvmjcdo", model.endTime()); - Assertions.assertEquals("bidyv", model.startTime()); - Assertions.assertEquals("owx", model.timeZone()); - Assertions.assertEquals("ksrl", model.expression()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java deleted file mode 100644 index 0204d2f8ca62d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomForecastHorizon; -import org.junit.jupiter.api.Assertions; - -public final class CustomForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomForecastHorizon model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":632851650}").toObject(CustomForecastHorizon.class); - Assertions.assertEquals(632851650, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomForecastHorizon model = new CustomForecastHorizon().withValue(632851650); - model = BinaryData.fromObject(model).toObject(CustomForecastHorizon.class); - Assertions.assertEquals(632851650, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java deleted file mode 100644 index e397e628a6a11..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomModelJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class CustomModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"custom_model\",\"mode\":\"Direct\",\"uri\":\"bkjbz\",\"description\":\"nsvk\"}") - .toObject(CustomModelJobInput.class); - Assertions.assertEquals("nsvk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("bkjbz", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomModelJobInput model = - new CustomModelJobInput().withDescription("nsvk").withMode(InputDeliveryMode.DIRECT).withUri("bkjbz"); - model = BinaryData.fromObject(model).toObject(CustomModelJobInput.class); - Assertions.assertEquals("nsvk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("bkjbz", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java deleted file mode 100644 index af669e82b1c3b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class CustomModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"custom_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"tjknsxfwushcdp\",\"description\":\"pn\"}") - .toObject(CustomModelJobOutput.class); - Assertions.assertEquals("pn", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("tjknsxfwushcdp", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomModelJobOutput model = - new CustomModelJobOutput() - .withDescription("pn") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("tjknsxfwushcdp"); - model = BinaryData.fromObject(model).toObject(CustomModelJobOutput.class); - Assertions.assertEquals("pn", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("tjknsxfwushcdp", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java deleted file mode 100644 index 07b772a2ac82a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomNCrossValidations; -import org.junit.jupiter.api.Assertions; - -public final class CustomNCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":691698964}").toObject(CustomNCrossValidations.class); - Assertions.assertEquals(691698964, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomNCrossValidations model = new CustomNCrossValidations().withValue(691698964); - model = BinaryData.fromObject(model).toObject(CustomNCrossValidations.class); - Assertions.assertEquals(691698964, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java deleted file mode 100644 index 8f1caf6d57906..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomSeasonality; -import org.junit.jupiter.api.Assertions; - -public final class CustomSeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomSeasonality model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":1578351643}").toObject(CustomSeasonality.class); - Assertions.assertEquals(1578351643, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomSeasonality model = new CustomSeasonality().withValue(1578351643); - model = BinaryData.fromObject(model).toObject(CustomSeasonality.class); - Assertions.assertEquals(1578351643, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java deleted file mode 100644 index b6cfdaad5bdf8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomTargetLags; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomTargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomTargetLags model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"values\":[915823701,1407190218,425904374]}") - .toObject(CustomTargetLags.class); - Assertions.assertEquals(915823701, model.values().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomTargetLags model = new CustomTargetLags().withValues(Arrays.asList(915823701, 1407190218, 425904374)); - model = BinaryData.fromObject(model).toObject(CustomTargetLags.class); - Assertions.assertEquals(915823701, model.values().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java deleted file mode 100644 index 6af5bc3d69578..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomTargetRollingWindowSize; -import org.junit.jupiter.api.Assertions; - -public final class CustomTargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomTargetRollingWindowSize model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"value\":482115950}") - .toObject(CustomTargetRollingWindowSize.class); - Assertions.assertEquals(482115950, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomTargetRollingWindowSize model = new CustomTargetRollingWindowSize().withValue(482115950); - model = BinaryData.fromObject(model).toObject(CustomTargetRollingWindowSize.class); - Assertions.assertEquals(482115950, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java deleted file mode 100644 index 80d46d3567473..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"dataType\":\"uri_folder\",\"isArchived\":true,\"latestVersion\":\"ycnunvjsrtk\",\"nextVersion\":\"wnopqgikyzirtx\",\"description\":\"uxzejntpsew\",\"properties\":{\"rydxtqm\":\"ilqu\"},\"tags\":{\"f\":\"xorgg\"}},\"id\":\"aomtbghhavgrvkff\",\"name\":\"vjzhpjbib\",\"type\":\"jmfxumvf\"}") - .toObject(DataContainerInner.class); - Assertions.assertEquals("uxzejntpsew", model.properties().description()); - Assertions.assertEquals("ilqu", model.properties().properties().get("rydxtqm")); - Assertions.assertEquals("xorgg", model.properties().tags().get("f")); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FOLDER, model.properties().dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerInner model = - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("uxzejntpsew") - .withProperties(mapOf("rydxtqm", "ilqu")) - .withTags(mapOf("f", "xorgg")) - .withIsArchived(true) - .withDataType(DataType.URI_FOLDER)); - model = BinaryData.fromObject(model).toObject(DataContainerInner.class); - Assertions.assertEquals("uxzejntpsew", model.properties().description()); - Assertions.assertEquals("ilqu", model.properties().properties().get("rydxtqm")); - Assertions.assertEquals("xorgg", model.properties().tags().get("f")); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FOLDER, model.properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java deleted file mode 100644 index 2b0434e60be5c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerProperties model = - BinaryData - .fromString( - "{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"vwxnbkfe\",\"nextVersion\":\"xscyhwzdgirujbz\",\"description\":\"mvzzbtdcqvp\",\"properties\":{\"n\":\"ujviylwdshfs\",\"rymsgaojfmw\":\"bgye\",\"hirctymoxoftpipi\":\"cotmr\",\"lihhyuspskasdvlm\":\"yczuhxacpq\"},\"tags\":{\"ulucv\":\"gz\",\"urisjnhnytxifqj\":\"amrsreuzv\",\"esutrgjupauutpw\":\"gxmrhublwp\",\"jqgwzp\":\"qhih\"}}") - .toObject(DataContainerProperties.class); - Assertions.assertEquals("mvzzbtdcqvp", model.description()); - Assertions.assertEquals("ujviylwdshfs", model.properties().get("n")); - Assertions.assertEquals("gz", model.tags().get("ulucv")); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(DataType.MLTABLE, model.dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerProperties model = - new DataContainerProperties() - .withDescription("mvzzbtdcqvp") - .withProperties( - mapOf( - "n", - "ujviylwdshfs", - "rymsgaojfmw", - "bgye", - "hirctymoxoftpipi", - "cotmr", - "lihhyuspskasdvlm", - "yczuhxacpq")) - .withTags( - mapOf( - "ulucv", - "gz", - "urisjnhnytxifqj", - "amrsreuzv", - "esutrgjupauutpw", - "gxmrhublwp", - "jqgwzp", - "qhih")) - .withIsArchived(false) - .withDataType(DataType.MLTABLE); - model = BinaryData.fromObject(model).toObject(DataContainerProperties.class); - Assertions.assertEquals("mvzzbtdcqvp", model.description()); - Assertions.assertEquals("ujviylwdshfs", model.properties().get("n")); - Assertions.assertEquals("gz", model.tags().get("ulucv")); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(DataType.MLTABLE, model.dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index a4e0717beafe1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataContainerResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"ufxqknpirgnepttw\",\"value\":[{\"properties\":{\"dataType\":\"uri_file\",\"isArchived\":true,\"latestVersion\":\"cdm\",\"nextVersion\":\"r\",\"description\":\"lpijnkrxfrd\",\"properties\":{},\"tags\":{}},\"id\":\"atiz\",\"name\":\"ronasxift\",\"type\":\"zq\"},{\"properties\":{\"dataType\":\"uri_folder\",\"isArchived\":false,\"latestVersion\":\"wesgogczh\",\"nextVersion\":\"nxkrlgnyhmossxkk\",\"description\":\"h\",\"properties\":{},\"tags\":{}},\"id\":\"xjb\",\"name\":\"hqxvcxgfrpdsofbs\",\"type\":\"rnsvbuswd\"}]}") - .toObject(DataContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ufxqknpirgnepttw", model.nextLink()); - Assertions.assertEquals("lpijnkrxfrd", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, model.value().get(0).properties().dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerResourceArmPaginatedResult model = - new DataContainerResourceArmPaginatedResult() - .withNextLink("ufxqknpirgnepttw") - .withValue( - Arrays - .asList( - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("lpijnkrxfrd") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true) - .withDataType(DataType.URI_FILE)), - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("h") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false) - .withDataType(DataType.URI_FOLDER)))); - model = BinaryData.fromObject(model).toObject(DataContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ufxqknpirgnepttw", model.nextLink()); - Assertions.assertEquals("lpijnkrxfrd", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, model.value().get(0).properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c21fbede1d469..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"kc\",\"nextVersion\":\"gzkj\",\"description\":\"qpdwad\",\"properties\":{\"qymjzucwwmejjqhd\":\"ztldsvczdjiah\"},\"tags\":{\"yfozkbnzxbypfqp\":\"mqxiyoo\",\"r\":\"aix\"}},\"id\":\"kkderfrswq\",\"name\":\"kwepwo\",\"type\":\"ggicwnxhtfmcqbs\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataContainer response = - manager - .dataContainers() - .define("yizwbxgdebxla") - .withExistingWorkspace("ddtgctxegtvgwy", "rbelfnzz") - .withProperties( - new DataContainerProperties() - .withDescription("cpjs") - .withProperties( - mapOf("cucsqsnxfbxu", "em", "su", "eapdrbzyv", "hmhjd", "dulpodkaxpfobk", "eluqr", "lt")) - .withTags(mapOf("srkgz", "dhfztlra", "dbkuwpzqxlcwe", "yh", "qufqizj", "kfecjvxf")) - .withIsArchived(false) - .withDataType(DataType.URI_FOLDER)) - .create(); - - Assertions.assertEquals("qpdwad", response.properties().description()); - Assertions.assertEquals("ztldsvczdjiah", response.properties().properties().get("qymjzucwwmejjqhd")); - Assertions.assertEquals("mqxiyoo", response.properties().tags().get("yfozkbnzxbypfqp")); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(DataType.MLTABLE, response.properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 3db0566ca853b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataContainers().deleteWithResponse("zx", "kn", "fdrld", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java deleted file mode 100644 index 49bf49716b24d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"uri_file\",\"isArchived\":false,\"latestVersion\":\"zcsozjvxdz\",\"nextVersion\":\"ggbnvtxo\",\"description\":\"alzyxwhoeamo\",\"properties\":{\"fpnimtwuuhaueg\":\"doey\",\"zjy\":\"kwmnfeub\"},\"tags\":{\"nqd\":\"fugiphrrkuu\",\"opueo\":\"rhzz\"}},\"id\":\"svwlujop\",\"name\":\"nibittoztjdqumq\",\"type\":\"fmwc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataContainer response = - manager - .dataContainers() - .getWithResponse("yehi", "ittugyu", "wrldax", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("alzyxwhoeamo", response.properties().description()); - Assertions.assertEquals("doey", response.properties().properties().get("fpnimtwuuhaueg")); - Assertions.assertEquals("fugiphrrkuu", response.properties().tags().get("nqd")); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, response.properties().dataType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java deleted file mode 100644 index de0d56c7ab37e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataType; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"yeyzm\",\"nextVersion\":\"sqc\",\"description\":\"nxlzbuwodmach\",\"properties\":{\"rmvgoqplehmumkz\":\"nrpb\",\"prwnhkgqggoxsst\":\"llcz\",\"cwmhlymgnukxrk\":\"ivrakfrryn\"},\"tags\":{\"clakku\":\"pequlrlzaudgjtf\",\"toucgj\":\"ddwnhczb\",\"slvlizedvb\":\"irjwayhicqqwwvgw\",\"srgekzyqxadyfhb\":\"abv\"}},\"id\":\"khojqttbspvk\",\"name\":\"glaqjsg\",\"type\":\"zstuj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataContainers() - .list( - "itcdqlhchwhrk", - "jlei", - "ibfiplhxfnsm", - ListViewType.ARCHIVED_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nxlzbuwodmach", response.iterator().next().properties().description()); - Assertions.assertEquals("nrpb", response.iterator().next().properties().properties().get("rmvgoqplehmumkz")); - Assertions.assertEquals("pequlrlzaudgjtf", response.iterator().next().properties().tags().get("clakku")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - Assertions.assertEquals(DataType.MLTABLE, response.iterator().next().properties().dataType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java deleted file mode 100644 index d24b30e51dd2f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataFactory; -import org.junit.jupiter.api.Assertions; - -public final class DataFactoryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataFactory model = - BinaryData - .fromString( - "{\"computeType\":\"DataFactory\",\"computeLocation\":\"anurnnqb\",\"provisioningState\":\"Unknown\",\"description\":\"izxqltgrd\",\"createdOn\":\"2021-08-08T02:29:28Z\",\"modifiedOn\":\"2021-03-28T12:05:51Z\",\"resourceId\":\"x\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}") - .toObject(DataFactory.class); - Assertions.assertEquals("anurnnqb", model.computeLocation()); - Assertions.assertEquals("izxqltgrd", model.description()); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataFactory model = - new DataFactory() - .withComputeLocation("anurnnqb") - .withDescription("izxqltgrd") - .withResourceId("x") - .withDisableLocalAuth(false); - model = BinaryData.fromObject(model).toObject(DataFactory.class); - Assertions.assertEquals("anurnnqb", model.computeLocation()); - Assertions.assertEquals("izxqltgrd", model.description()); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java deleted file mode 100644 index dd2067f2876c0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsSchemaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalyticsSchemaProperties model = - BinaryData - .fromString("{\"dataLakeStoreAccountName\":\"b\"}") - .toObject(DataLakeAnalyticsSchemaProperties.class); - Assertions.assertEquals("b", model.dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalyticsSchemaProperties model = - new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("b"); - model = BinaryData.fromObject(model).toObject(DataLakeAnalyticsSchemaProperties.class); - Assertions.assertEquals("b", model.dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java deleted file mode 100644 index 5529cf53c492c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchema; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalyticsSchema model = - BinaryData - .fromString("{\"properties\":{\"dataLakeStoreAccountName\":\"mg\"}}") - .toObject(DataLakeAnalyticsSchema.class); - Assertions.assertEquals("mg", model.properties().dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalyticsSchema model = - new DataLakeAnalyticsSchema() - .withProperties(new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("mg")); - model = BinaryData.fromObject(model).toObject(DataLakeAnalyticsSchema.class); - Assertions.assertEquals("mg", model.properties().dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java deleted file mode 100644 index 3f98d4cf05ae7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalytics; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalytics model = - BinaryData - .fromString( - "{\"computeType\":\"DataLakeAnalytics\",\"properties\":{\"dataLakeStoreAccountName\":\"wrxaomzisg\"},\"computeLocation\":\"rczezkhhlt\",\"provisioningState\":\"Deleting\",\"description\":\"hqo\",\"createdOn\":\"2021-11-21T17:40:44Z\",\"modifiedOn\":\"2021-08-05T21:29:34Z\",\"resourceId\":\"ueayfbpcmsplb\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true}") - .toObject(DataLakeAnalytics.class); - Assertions.assertEquals("rczezkhhlt", model.computeLocation()); - Assertions.assertEquals("hqo", model.description()); - Assertions.assertEquals("ueayfbpcmsplb", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalytics model = - new DataLakeAnalytics() - .withComputeLocation("rczezkhhlt") - .withDescription("hqo") - .withResourceId("ueayfbpcmsplb") - .withDisableLocalAuth(true) - .withProperties(new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("wrxaomzisg")); - model = BinaryData.fromObject(model).toObject(DataLakeAnalytics.class); - Assertions.assertEquals("rczezkhhlt", model.computeLocation()); - Assertions.assertEquals("hqo", model.description()); - Assertions.assertEquals("ueayfbpcmsplb", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java deleted file mode 100644 index 88749f1779a12..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataPathAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class DataPathAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataPathAssetReference model = - BinaryData - .fromString( - "{\"referenceType\":\"DataPath\",\"datastoreId\":\"uwxeoiojfizf\",\"path\":\"kjzwfbcyayk\"}") - .toObject(DataPathAssetReference.class); - Assertions.assertEquals("uwxeoiojfizf", model.datastoreId()); - Assertions.assertEquals("kjzwfbcyayk", model.path()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataPathAssetReference model = - new DataPathAssetReference().withDatastoreId("uwxeoiojfizf").withPath("kjzwfbcyayk"); - model = BinaryData.fromObject(model).toObject(DataPathAssetReference.class); - Assertions.assertEquals("uwxeoiojfizf", model.datastoreId()); - Assertions.assertEquals("kjzwfbcyayk", model.path()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java deleted file mode 100644 index 33fbb9af69258..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"vpkjpr\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"ql\",\"properties\":{\"dshmkxmaehvbbx\":\"gtczheydb\"},\"tags\":{\"kgxywr\":\"pltfnhtba\"}},\"id\":\"pyklyhpluodpvru\",\"name\":\"dlgzibthostgkt\",\"type\":\"tvdxeclzedqb\"}") - .toObject(DataVersionBaseInner.class); - Assertions.assertEquals("ql", model.properties().description()); - Assertions.assertEquals("gtczheydb", model.properties().properties().get("dshmkxmaehvbbx")); - Assertions.assertEquals("pltfnhtba", model.properties().tags().get("kgxywr")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("vpkjpr", model.properties().dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseInner model = - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("ql") - .withProperties(mapOf("dshmkxmaehvbbx", "gtczheydb")) - .withTags(mapOf("kgxywr", "pltfnhtba")) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("vpkjpr")); - model = BinaryData.fromObject(model).toObject(DataVersionBaseInner.class); - Assertions.assertEquals("ql", model.properties().description()); - Assertions.assertEquals("gtczheydb", model.properties().properties().get("dshmkxmaehvbbx")); - Assertions.assertEquals("pltfnhtba", model.properties().tags().get("kgxywr")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("vpkjpr", model.properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java deleted file mode 100644 index 4067e2dd17217..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseProperties model = - BinaryData - .fromString( - "{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"vh\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"dqkdlwwqfbu\",\"properties\":{\"lmbtxhwgfwsrt\":\"xtrqjfs\",\"kh\":\"wcoezbrhub\"},\"tags\":{\"kkqfqjbvle\":\"goo\"}}") - .toObject(DataVersionBaseProperties.class); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("xtrqjfs", model.properties().get("lmbtxhwgfwsrt")); - Assertions.assertEquals("goo", model.tags().get("kkqfqjbvle")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("vh", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseProperties model = - new DataVersionBaseProperties() - .withDescription("dqkdlwwqfbu") - .withProperties(mapOf("lmbtxhwgfwsrt", "xtrqjfs", "kh", "wcoezbrhub")) - .withTags(mapOf("kkqfqjbvle", "goo")) - .withIsAnonymous(false) - .withIsArchived(true) - .withDataUri("vh"); - model = BinaryData.fromObject(model).toObject(DataVersionBaseProperties.class); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("xtrqjfs", model.properties().get("lmbtxhwgfwsrt")); - Assertions.assertEquals("goo", model.tags().get("kkqfqjbvle")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("vh", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java deleted file mode 100644 index c498cc1b9ac60..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBaseResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"qntcypsxjvfoimwk\",\"value\":[{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"rcizjxvyd\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"lhvygdyftu\",\"properties\":{},\"tags\":{}},\"id\":\"nawjslbiwkojgcy\",\"name\":\"tsf\",\"type\":\"z\"},{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"baeqphc\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"pxehuwrykqga\",\"properties\":{},\"tags\":{}},\"id\":\"iklbydvkhb\",\"name\":\"jdz\",\"type\":\"xcv\"},{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"srhnjivo\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"qfzgemjdftul\",\"properties\":{},\"tags\":{}},\"id\":\"ucea\",\"name\":\"tmczuomejwcwwqi\",\"type\":\"knssxmojm\"}]}") - .toObject(DataVersionBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("qntcypsxjvfoimwk", model.nextLink()); - Assertions.assertEquals("lhvygdyftu", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("rcizjxvyd", model.value().get(0).properties().dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseResourceArmPaginatedResult model = - new DataVersionBaseResourceArmPaginatedResult() - .withNextLink("qntcypsxjvfoimwk") - .withValue( - Arrays - .asList( - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("lhvygdyftu") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("rcizjxvyd")), - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("pxehuwrykqga") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("baeqphc")), - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("qfzgemjdftul") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("srhnjivo")))); - model = BinaryData.fromObject(model).toObject(DataVersionBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("qntcypsxjvfoimwk", model.nextLink()); - Assertions.assertEquals("lhvygdyftu", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("rcizjxvyd", model.value().get(0).properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 627299b201b6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"sx\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"orimmo\",\"properties\":{\"kkmvhzfovanyrva\":\"de\",\"ewikfyaqandmym\":\"rtgelg\"},\"tags\":{\"bpbvzopaxmf\":\"qjumovs\",\"faxdtnqifbsa\":\"vsmcwo\"}},\"id\":\"oiauesugmocpcj\",\"name\":\"cboe\",\"type\":\"rgttw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataVersionBase response = - manager - .dataVersions() - .define("qich") - .withExistingData("vdhgjnaqyqip", "lzmvcdsvmwbi", "ekdtfobvfiyb") - .withProperties( - new DataVersionBaseProperties() - .withDescription("ulrqtbht") - .withProperties(mapOf("ryfmxmdu", "pzl", "giln", "zf")) - .withTags( - mapOf( - "qqyeqfcb", - "ccgndjgdprig", - "fsh", - "ulpyuflq", - "klkqnqvkixnmb", - "ujcyohigimwdc", - "zayspzvriet", - "mecuyrzwim")) - .withIsAnonymous(true) - .withIsArchived(true) - .withDataUri("ybfzdqekivycp")) - .create(); - - Assertions.assertEquals("orimmo", response.properties().description()); - Assertions.assertEquals("de", response.properties().properties().get("kkmvhzfovanyrva")); - Assertions.assertEquals("qjumovs", response.properties().tags().get("bpbvzopaxmf")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("sx", response.properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index fe4af1524ea9a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .dataVersions() - .deleteWithResponse( - "qrxqwqnjx", "dfddtullygtav", "zcxdfweapyfmlxrl", "phraspifleim", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java deleted file mode 100644 index 32ac248ee912f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"mtznpaxwfqtyyqi\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"ngbso\",\"properties\":{\"zbkuckgkdsksw\":\"kmii\",\"woykdnonaaxwm\":\"iiqqcqikclsmalns\"},\"tags\":{\"q\":\"ujlqcwnynlle\"}},\"id\":\"bgvsbtsertoxadh\",\"name\":\"uvjhxmnrqstjc\",\"type\":\"etwmlgicvnp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataVersionBase response = - manager - .dataVersions() - .getWithResponse("x", "mdbgi", "ehfgsm", "rjuqbpxtokl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ngbso", response.properties().description()); - Assertions.assertEquals("kmii", response.properties().properties().get("zbkuckgkdsksw")); - Assertions.assertEquals("ujlqcwnynlle", response.properties().tags().get("q")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("mtznpaxwfqtyyqi", response.properties().dataUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java deleted file mode 100644 index f5a6b45c3561c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"pjyyqmkwlhvc\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"jk\",\"properties\":{\"uzmsxgam\":\"xrwzo\"},\"tags\":{\"j\":\"kwppthuzdprmimr\",\"xyemhkft\":\"poq\",\"tecloamfmxtll\":\"aew\"}},\"id\":\"tymqcnrrfijhggab\",\"name\":\"bgamklilirwd\",\"type\":\"ffhsdpzouhk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataVersions() - .list( - "d", - "pgchzpgfqum", - "djxh", - "ghgodkynrceq", - 233157705, - "fdbdfmmxj", - "naj", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jk", response.iterator().next().properties().description()); - Assertions.assertEquals("xrwzo", response.iterator().next().properties().properties().get("uzmsxgam")); - Assertions.assertEquals("kwppthuzdprmimr", response.iterator().next().properties().tags().get("j")); - Assertions.assertEquals(true, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions.assertEquals("pjyyqmkwlhvc", response.iterator().next().properties().dataUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java deleted file mode 100644 index 3716ec3a07fac..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; -import com.azure.resourcemanager.machinelearning.models.DatastoreProperties; -import com.azure.resourcemanager.machinelearning.models.DatastoreResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DatastoreResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatastoreResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"fmluiqtqzfavyvn\",\"value\":[{\"properties\":{\"datastoreType\":\"DatastoreProperties\",\"isDefault\":false,\"description\":\"yeua\",\"properties\":{},\"tags\":{}},\"id\":\"abqgzslesjcbh\",\"name\":\"rnntiewdjcv\",\"type\":\"quwrbehwag\"}]}") - .toObject(DatastoreResourceArmPaginatedResult.class); - Assertions.assertEquals("fmluiqtqzfavyvn", model.nextLink()); - Assertions.assertEquals("yeua", model.value().get(0).properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatastoreResourceArmPaginatedResult model = - new DatastoreResourceArmPaginatedResult() - .withNextLink("fmluiqtqzfavyvn") - .withValue( - Arrays - .asList( - new DatastoreInner() - .withProperties( - new DatastoreProperties() - .withDescription("yeua") - .withProperties(mapOf()) - .withTags(mapOf())))); - model = BinaryData.fromObject(model).toObject(DatastoreResourceArmPaginatedResult.class); - Assertions.assertEquals("fmluiqtqzfavyvn", model.nextLink()); - Assertions.assertEquals("yeua", model.value().get(0).properties().description()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java deleted file mode 100644 index 0fdbce8dfb9d3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatastoresDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .datastores() - .deleteWithResponse("bp", "nupoyryefqmwovyz", "xlnomfpbjcee", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java deleted file mode 100644 index 6aebf34094fec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; - -public final class DefaultScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefaultScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"Default\"}").toObject(DefaultScaleSettings.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefaultScaleSettings model = new DefaultScaleSettings(); - model = BinaryData.fromObject(model).toObject(DefaultScaleSettings.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java deleted file mode 100644 index 97597fc5b2a11..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DeploymentLogsInner; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentLogsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentLogsInner model = - BinaryData.fromString("{\"content\":\"jcxcjxgrytfmpcyc\"}").toObject(DeploymentLogsInner.class); - Assertions.assertEquals("jcxcjxgrytfmpcyc", model.content()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentLogsInner model = new DeploymentLogsInner().withContent("jcxcjxgrytfmpcyc"); - model = BinaryData.fromObject(model).toObject(DeploymentLogsInner.class); - Assertions.assertEquals("jcxcjxgrytfmpcyc", model.content()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java deleted file mode 100644 index 82ee2e9d4bd43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentLogsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentLogsRequest model = - BinaryData - .fromString("{\"containerType\":\"StorageInitializer\",\"tail\":304740778}") - .toObject(DeploymentLogsRequest.class); - Assertions.assertEquals(ContainerType.STORAGE_INITIALIZER, model.containerType()); - Assertions.assertEquals(304740778, model.tail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentLogsRequest model = - new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(304740778); - model = BinaryData.fromObject(model).toObject(DeploymentLogsRequest.class); - Assertions.assertEquals(ContainerType.STORAGE_INITIALIZER, model.containerType()); - Assertions.assertEquals(304740778, model.tail()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java deleted file mode 100644 index ec591bc0c0ab7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DeploymentResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentResourceConfiguration model = - BinaryData - .fromString( - "{\"instanceCount\":1806206586,\"instanceType\":\"dcfhucqdpf\",\"properties\":{\"vudutncor\":\"datalsbjjcanvxbv\",\"xqtvcofu\":\"datar\"}}") - .toObject(DeploymentResourceConfiguration.class); - Assertions.assertEquals(1806206586, model.instanceCount()); - Assertions.assertEquals("dcfhucqdpf", model.instanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentResourceConfiguration model = - new DeploymentResourceConfiguration() - .withInstanceCount(1806206586) - .withInstanceType("dcfhucqdpf") - .withProperties(mapOf("vudutncor", "datalsbjjcanvxbv", "xqtvcofu", "datar")); - model = BinaryData.fromObject(model).toObject(DeploymentResourceConfiguration.class); - Assertions.assertEquals(1806206586, model.instanceCount()); - Assertions.assertEquals("dcfhucqdpf", model.instanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java deleted file mode 100644 index 79a8c8e054660..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DistributionConfiguration; - -public final class DistributionConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DistributionConfiguration model = - BinaryData - .fromString("{\"distributionType\":\"DistributionConfiguration\"}") - .toObject(DistributionConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DistributionConfiguration model = new DistributionConfiguration(); - model = BinaryData.fromObject(model).toObject(DistributionConfiguration.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java deleted file mode 100644 index 48a697c830af2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import org.junit.jupiter.api.Assertions; - -public final class EarlyTerminationPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EarlyTerminationPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1491450827,\"evaluationInterval\":935954000}") - .toObject(EarlyTerminationPolicy.class); - Assertions.assertEquals(1491450827, model.delayEvaluation()); - Assertions.assertEquals(935954000, model.evaluationInterval()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EarlyTerminationPolicy model = - new EarlyTerminationPolicy().withDelayEvaluation(1491450827).withEvaluationInterval(935954000); - model = BinaryData.fromObject(model).toObject(EarlyTerminationPolicy.class); - Assertions.assertEquals(1491450827, model.delayEvaluation()); - Assertions.assertEquals(935954000, model.evaluationInterval()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java deleted file mode 100644 index b2079ae77443a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EndpointScheduleAction; - -public final class EndpointScheduleActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointScheduleAction model = - BinaryData - .fromString("{\"actionType\":\"InvokeBatchEndpoint\",\"endpointInvocationDefinition\":\"datamfzsbf\"}") - .toObject(EndpointScheduleAction.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointScheduleAction model = new EndpointScheduleAction().withEndpointInvocationDefinition("datamfzsbf"); - model = BinaryData.fromObject(model).toObject(EndpointScheduleAction.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java deleted file mode 100644 index 876683c15f202..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ulfgslqu\",\"nextVersion\":\"wdlenrdsut\",\"description\":\"bazpjuohmi\",\"properties\":{\"wpklvxw\":\"lnorwmdu\",\"epn\":\"ygdxpgpqchis\",\"fozauorsuk\":\"bjcrxgibbdaxco\"},\"tags\":{\"vnuuepzl\":\"bqplh\",\"vmnnrw\":\"phwzsoldweyuqdu\"}},\"id\":\"i\",\"name\":\"rk\",\"type\":\"alywjhhgdn\"}") - .toObject(EnvironmentContainerInner.class); - Assertions.assertEquals("bazpjuohmi", model.properties().description()); - Assertions.assertEquals("lnorwmdu", model.properties().properties().get("wpklvxw")); - Assertions.assertEquals("bqplh", model.properties().tags().get("vnuuepzl")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerInner model = - new EnvironmentContainerInner() - .withProperties( - new EnvironmentContainerProperties() - .withDescription("bazpjuohmi") - .withProperties( - mapOf("wpklvxw", "lnorwmdu", "epn", "ygdxpgpqchis", "fozauorsuk", "bjcrxgibbdaxco")) - .withTags(mapOf("vnuuepzl", "bqplh", "vmnnrw", "phwzsoldweyuqdu")) - .withIsArchived(false)); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerInner.class); - Assertions.assertEquals("bazpjuohmi", model.properties().description()); - Assertions.assertEquals("lnorwmdu", model.properties().properties().get("wpklvxw")); - Assertions.assertEquals("bqplh", model.properties().tags().get("vnuuepzl")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java deleted file mode 100644 index db15e9292ceee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"ivfomiloxgg\",\"nextVersion\":\"fi\",\"description\":\"dieuzaofj\",\"properties\":{\"ubiipuipwoqonma\":\"cyyysfgdot\"},\"tags\":{\"izsh\":\"k\"}}") - .toObject(EnvironmentContainerProperties.class); - Assertions.assertEquals("dieuzaofj", model.description()); - Assertions.assertEquals("cyyysfgdot", model.properties().get("ubiipuipwoqonma")); - Assertions.assertEquals("k", model.tags().get("izsh")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerProperties model = - new EnvironmentContainerProperties() - .withDescription("dieuzaofj") - .withProperties(mapOf("ubiipuipwoqonma", "cyyysfgdot")) - .withTags(mapOf("izsh", "k")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerProperties.class); - Assertions.assertEquals("dieuzaofj", model.description()); - Assertions.assertEquals("cyyysfgdot", model.properties().get("ubiipuipwoqonma")); - Assertions.assertEquals("k", model.tags().get("izsh")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index f52bf87e95c97..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"buffkmrqemvvhm\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"utacoe\",\"nextVersion\":\"vewzcj\",\"description\":\"m\",\"properties\":{},\"tags\":{}},\"id\":\"guaadraufactkahz\",\"name\":\"v\",\"type\":\"jjziuxxpsh\"}]}") - .toObject(EnvironmentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("buffkmrqemvvhm", model.nextLink()); - Assertions.assertEquals("m", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerResourceArmPaginatedResult model = - new EnvironmentContainerResourceArmPaginatedResult() - .withNextLink("buffkmrqemvvhm") - .withValue( - Arrays - .asList( - new EnvironmentContainerInner() - .withProperties( - new EnvironmentContainerProperties() - .withDescription("m") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)))); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("buffkmrqemvvhm", model.nextLink()); - Assertions.assertEquals("m", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 2b0670da2c8be..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"jenvjeateaxx\",\"nextVersion\":\"xoxdjxldnaryyi\",\"description\":\"kd\",\"properties\":{\"zaledoyqxlunkf\":\"ndwdbvx\",\"oanpohrvm\":\"hmcxqqxmyzkl\",\"a\":\"rqra\",\"k\":\"ivznllas\"},\"tags\":{\"aihxjtgzgtaiywbq\":\"jqjpv\",\"mhljqlxspm\":\"roigbsfsgsaenwld\"}},\"id\":\"ctr\",\"name\":\"ldsxebuhsxrz\",\"type\":\"mgsdaluyckhefrbh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentContainer response = - manager - .environmentContainers() - .define("vsolzwil") - .withExistingWorkspace("dofuckclb", "xlu") - .withProperties( - new EnvironmentContainerProperties() - .withDescription("dkktpmbmxbmbrwgz") - .withProperties(mapOf("hxsdplaumydmhwe", "jb", "xydgtokvqbvwg", "jf", "lhpses", "gwzpvxak")) - .withTags( - mapOf( - "goqg", - "amqiydvxcgdhy", - "spglq", - "oyqyxyjrcbqpb", - "tdahneaoovtyjzti", - "o", - "ekfsrm", - "fwjlof")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("kd", response.properties().description()); - Assertions.assertEquals("ndwdbvx", response.properties().properties().get("zaledoyqxlunkf")); - Assertions.assertEquals("jqjpv", response.properties().tags().get("aihxjtgzgtaiywbq")); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 4fe0f354d62e5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .environmentContainers() - .deleteWithResponse("d", "fa", "rptvcshtkutzcttb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java deleted file mode 100644 index b4f4b37be1a2a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"jirmuydgfttm\",\"nextVersion\":\"fgeoagfuoftnx\",\"description\":\"wxmdaj\",\"properties\":{\"gsevmdm\":\"g\",\"zljdnci\":\"enlrstgf\"},\"tags\":{\"cvucgytoxu\":\"vamyyznmrgcdo\",\"qmebgszplusdekpd\":\"httnzqs\",\"ssgpgvo\":\"z\",\"cwztlvvws\":\"yejidbdqzsqun\"}},\"id\":\"rkky\",\"name\":\"trepw\",\"type\":\"wfkcauxuvavcpf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentContainer response = - manager - .environmentContainers() - .getWithResponse("gdirda", "m", "zjgcfjfx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wxmdaj", response.properties().description()); - Assertions.assertEquals("g", response.properties().properties().get("gsevmdm")); - Assertions.assertEquals("vamyyznmrgcdo", response.properties().tags().get("cvucgytoxu")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java deleted file mode 100644 index 8be28b3cf8d39..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ipsdudgcozzomehx\",\"nextVersion\":\"ntolamlb\",\"description\":\"uxkqllczipvwdt\",\"properties\":{\"kwx\":\"zdqiqdlrat\",\"lhpryjfzihuio\":\"auwxsuykznhrfgsl\",\"pajtfeyvkbd\":\"eo\",\"rhd\":\"dd\"},\"tags\":{\"zytijcx\":\"beuuqutkzwtjwwg\",\"qkkkbjuckcatuqbh\":\"nondegjdyd\"}},\"id\":\"wcnxtpzdlyseid\",\"name\":\"oa\",\"type\":\"atprytgrhzbq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .environmentContainers() - .list( - "ddnvovbooqbmdq", - "xyglaetscflw", - "jdtlriefooyycux", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("uxkqllczipvwdt", response.iterator().next().properties().description()); - Assertions.assertEquals("zdqiqdlrat", response.iterator().next().properties().properties().get("kwx")); - Assertions.assertEquals("beuuqutkzwtjwwg", response.iterator().next().properties().tags().get("zytijcx")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java deleted file mode 100644 index a0f3ff3557bd1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"vizqzdwl\",\"dockerfilePath\":\"lyoupfgfbkju\"},\"condaFile\":\"yhgk\",\"environmentType\":\"Curated\",\"image\":\"sgow\",\"inferenceConfig\":{},\"osType\":\"Linux\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"bqactxtgzukx\",\"properties\":{\"tg\":\"m\",\"isavok\":\"qqxhrnxrxcpj\",\"azivjlfrqttbajl\":\"dzf\"},\"tags\":{\"dkqqfkuvscxkd\":\"nwxyiop\",\"oaz\":\"ligovibrxkpm\"}},\"id\":\"u\",\"name\":\"cbgoor\",\"type\":\"te\"}") - .toObject(EnvironmentVersionInner.class); - Assertions.assertEquals("bqactxtgzukx", model.properties().description()); - Assertions.assertEquals("m", model.properties().properties().get("tg")); - Assertions.assertEquals("nwxyiop", model.properties().tags().get("dkqqfkuvscxkd")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.properties().autoRebuild()); - Assertions.assertEquals("vizqzdwl", model.properties().build().contextUri()); - Assertions.assertEquals("lyoupfgfbkju", model.properties().build().dockerfilePath()); - Assertions.assertEquals("yhgk", model.properties().condaFile()); - Assertions.assertEquals("sgow", model.properties().image()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.properties().osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionInner model = - new EnvironmentVersionInner() - .withProperties( - new EnvironmentVersionProperties() - .withDescription("bqactxtgzukx") - .withProperties(mapOf("tg", "m", "isavok", "qqxhrnxrxcpj", "azivjlfrqttbajl", "dzf")) - .withTags(mapOf("dkqqfkuvscxkd", "nwxyiop", "oaz", "ligovibrxkpm")) - .withIsAnonymous(false) - .withIsArchived(true) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("vizqzdwl").withDockerfilePath("lyoupfgfbkju")) - .withCondaFile("yhgk") - .withImage("sgow") - .withInferenceConfig(new InferenceContainerProperties()) - .withOsType(OperatingSystemType.LINUX)); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionInner.class); - Assertions.assertEquals("bqactxtgzukx", model.properties().description()); - Assertions.assertEquals("m", model.properties().properties().get("tg")); - Assertions.assertEquals("nwxyiop", model.properties().tags().get("dkqqfkuvscxkd")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.properties().autoRebuild()); - Assertions.assertEquals("vizqzdwl", model.properties().build().contextUri()); - Assertions.assertEquals("lyoupfgfbkju", model.properties().build().dockerfilePath()); - Assertions.assertEquals("yhgk", model.properties().condaFile()); - Assertions.assertEquals("sgow", model.properties().image()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java deleted file mode 100644 index 8e545095d6971..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import com.azure.resourcemanager.machinelearning.models.Route; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionProperties model = - BinaryData - .fromString( - "{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"hjxa\",\"dockerfilePath\":\"vjgsl\"},\"condaFile\":\"dilmyww\",\"environmentType\":\"UserCreated\",\"image\":\"xnyed\",\"inferenceConfig\":{\"livenessRoute\":{\"path\":\"yvudtjuewbci\",\"port\":1871891438},\"readinessRoute\":{\"path\":\"uwhcjyxccybv\",\"port\":436827826},\"scoringRoute\":{\"path\":\"akkud\",\"port\":417091375}},\"osType\":\"Linux\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"agst\",\"properties\":{\"gsj\":\"hpfkyrkdbdgi\",\"obaiyhddviaceg\":\"mnwqj\",\"ntfpmvmemfnc\":\"n\",\"xlllchp\":\"dwvvba\"},\"tags\":{\"jcswsmys\":\"zevwrdnhfukuv\",\"lerchpq\":\"uluqypfc\"}}") - .toObject(EnvironmentVersionProperties.class); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("hpfkyrkdbdgi", model.properties().get("gsj")); - Assertions.assertEquals("zevwrdnhfukuv", model.tags().get("jcswsmys")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.autoRebuild()); - Assertions.assertEquals("hjxa", model.build().contextUri()); - Assertions.assertEquals("vjgsl", model.build().dockerfilePath()); - Assertions.assertEquals("dilmyww", model.condaFile()); - Assertions.assertEquals("xnyed", model.image()); - Assertions.assertEquals("yvudtjuewbci", model.inferenceConfig().livenessRoute().path()); - Assertions.assertEquals(1871891438, model.inferenceConfig().livenessRoute().port()); - Assertions.assertEquals("uwhcjyxccybv", model.inferenceConfig().readinessRoute().path()); - Assertions.assertEquals(436827826, model.inferenceConfig().readinessRoute().port()); - Assertions.assertEquals("akkud", model.inferenceConfig().scoringRoute().path()); - Assertions.assertEquals(417091375, model.inferenceConfig().scoringRoute().port()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionProperties model = - new EnvironmentVersionProperties() - .withDescription("agst") - .withProperties( - mapOf("gsj", "hpfkyrkdbdgi", "obaiyhddviaceg", "mnwqj", "ntfpmvmemfnc", "n", "xlllchp", "dwvvba")) - .withTags(mapOf("jcswsmys", "zevwrdnhfukuv", "lerchpq", "uluqypfc")) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("hjxa").withDockerfilePath("vjgsl")) - .withCondaFile("dilmyww") - .withImage("xnyed") - .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("yvudtjuewbci").withPort(1871891438)) - .withReadinessRoute(new Route().withPath("uwhcjyxccybv").withPort(436827826)) - .withScoringRoute(new Route().withPath("akkud").withPort(417091375))) - .withOsType(OperatingSystemType.LINUX); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionProperties.class); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("hpfkyrkdbdgi", model.properties().get("gsj")); - Assertions.assertEquals("zevwrdnhfukuv", model.tags().get("jcswsmys")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.autoRebuild()); - Assertions.assertEquals("hjxa", model.build().contextUri()); - Assertions.assertEquals("vjgsl", model.build().dockerfilePath()); - Assertions.assertEquals("dilmyww", model.condaFile()); - Assertions.assertEquals("xnyed", model.image()); - Assertions.assertEquals("yvudtjuewbci", model.inferenceConfig().livenessRoute().path()); - Assertions.assertEquals(1871891438, model.inferenceConfig().livenessRoute().port()); - Assertions.assertEquals("uwhcjyxccybv", model.inferenceConfig().readinessRoute().path()); - Assertions.assertEquals(436827826, model.inferenceConfig().readinessRoute().port()); - Assertions.assertEquals("akkud", model.inferenceConfig().scoringRoute().path()); - Assertions.assertEquals(417091375, model.inferenceConfig().scoringRoute().port()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index 7d0ac414f67a7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"cimpevfg\",\"value\":[{\"properties\":{\"autoRebuild\":\"Disabled\",\"condaFile\":\"bywdxsmicc\",\"environmentType\":\"Curated\",\"image\":\"scjfnyns\",\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"qytibyowbblgyavu\",\"properties\":{},\"tags\":{}},\"id\":\"joxoism\",\"name\":\"ksbpimlqoljx\",\"type\":\"cgxxlxs\"}]}") - .toObject(EnvironmentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("cimpevfg", model.nextLink()); - Assertions.assertEquals("qytibyowbblgyavu", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.DISABLED, model.value().get(0).properties().autoRebuild()); - Assertions.assertEquals("bywdxsmicc", model.value().get(0).properties().condaFile()); - Assertions.assertEquals("scjfnyns", model.value().get(0).properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, model.value().get(0).properties().osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionResourceArmPaginatedResult model = - new EnvironmentVersionResourceArmPaginatedResult() - .withNextLink("cimpevfg") - .withValue( - Arrays - .asList( - new EnvironmentVersionInner() - .withProperties( - new EnvironmentVersionProperties() - .withDescription("qytibyowbblgyavu") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.DISABLED) - .withCondaFile("bywdxsmicc") - .withImage("scjfnyns") - .withOsType(OperatingSystemType.WINDOWS)))); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("cimpevfg", model.nextLink()); - Assertions.assertEquals("qytibyowbblgyavu", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.DISABLED, model.value().get(0).properties().autoRebuild()); - Assertions.assertEquals("bywdxsmicc", model.value().get(0).properties().condaFile()); - Assertions.assertEquals("scjfnyns", model.value().get(0).properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, model.value().get(0).properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 301d807f7f9ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"bkfukdljq\",\"dockerfilePath\":\"tsdyds\"},\"condaFile\":\"pafyalo\",\"environmentType\":\"Curated\",\"image\":\"izzn\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"fyjfd\",\"properties\":{\"qh\":\"yvndjokgwesym\",\"ujqbbgsimwejl\":\"qpfzlpejtznxlue\",\"bcpr\":\"bkbpjzobd\"},\"tags\":{\"awp\":\"kuhydtnaczkfwfat\"}},\"id\":\"skivdwgtqcu\",\"name\":\"ecsaaqgoqbdiu\",\"type\":\"csbskowkrbh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentVersion response = - manager - .environmentVersions() - .define("wrqkza") - .withExistingEnvironment("h", "gsiqikvllr", "tpmglxkoikmtr") - .withProperties( - new EnvironmentVersionProperties() - .withDescription("sbvvdlsflxkqesdf") - .withProperties(mapOf("dklt", "bgzancoinmphymcq", "toj", "dhqnufbxweiib")) - .withTags( - mapOf( - "uaorhjk", - "nybydhuihaouwud", - "amqprlo", - "hwvumosqir", - "zcmtagelajdyolj", - "rugejcvjkjy", - "qfmzsizzhravrc", - "qy")) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("mpa").withDockerfilePath("wzlweeprn")) - .withCondaFile("zltkaszfj") - .withImage("bduxapgrcq") - .withInferenceConfig(new InferenceContainerProperties()) - .withOsType(OperatingSystemType.WINDOWS)) - .create(); - - Assertions.assertEquals("fyjfd", response.properties().description()); - Assertions.assertEquals("yvndjokgwesym", response.properties().properties().get("qh")); - Assertions.assertEquals("kuhydtnaczkfwfat", response.properties().tags().get("awp")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.properties().autoRebuild()); - Assertions.assertEquals("bkfukdljq", response.properties().build().contextUri()); - Assertions.assertEquals("tsdyds", response.properties().build().dockerfilePath()); - Assertions.assertEquals("pafyalo", response.properties().condaFile()); - Assertions.assertEquals("izzn", response.properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 59dc400d4ad1e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .environmentVersions() - .deleteWithResponse("hpyvdkgdet", "z", "canzb", "ekwuyckyvn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java deleted file mode 100644 index 9af7a5f2564ed..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"siecktybhj\",\"dockerfilePath\":\"idhhxomild\"},\"condaFile\":\"jxdugxwj\",\"environmentType\":\"Curated\",\"image\":\"qrslaate\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"wlxrhgt\",\"properties\":{\"korvvm\":\"tqqykbkkteozejog\",\"h\":\"mcofn\"},\"tags\":{\"li\":\"nosn\",\"z\":\"k\",\"etyalht\":\"j\",\"ttcucrcm\":\"mknazgbjbhrpgiq\"}},\"id\":\"ixpqj\",\"name\":\"wifhbksldttohq\",\"type\":\"lna\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentVersion response = - manager - .environmentVersions() - .getWithResponse("nsm", "ffiwjbctvbp", "ujqjtotdxp", "scsl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wlxrhgt", response.properties().description()); - Assertions.assertEquals("tqqykbkkteozejog", response.properties().properties().get("korvvm")); - Assertions.assertEquals("nosn", response.properties().tags().get("li")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.properties().autoRebuild()); - Assertions.assertEquals("siecktybhj", response.properties().build().contextUri()); - Assertions.assertEquals("idhhxomild", response.properties().build().dockerfilePath()); - Assertions.assertEquals("jxdugxwj", response.properties().condaFile()); - Assertions.assertEquals("qrslaate", response.properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.properties().osType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java deleted file mode 100644 index bb4f62f6016d0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"yljurkeposehqqyl\",\"dockerfilePath\":\"ctwjwdsdlzm\"},\"condaFile\":\"erxxxoteehkhowgo\",\"environmentType\":\"UserCreated\",\"image\":\"xowpcbapn\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"fey\",\"properties\":{\"jnmzp\":\"ocvvujexayglxrk\",\"ieidzlv\":\"slavxjfiuof\",\"ydv\":\"sqywjopacky\",\"izwgsoriobijeiyd\":\"kmfngpmillxgjs\"},\"tags\":{\"ybriop\":\"ynhbokayrg\",\"igsioctqkm\":\"weoftnorw\",\"xvzfffhtjnwos\":\"ja\",\"zqfcwrriomxee\":\"tfjxtvlx\"}},\"id\":\"yhjm\",\"name\":\"jiqegmxdbs\",\"type\":\"hc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .environmentVersions() - .list( - "eu", - "rbgpxeb", - "ludca", - "tujraxdtpryjm", - 1855345037, - "nsewouxl", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fey", response.iterator().next().properties().description()); - Assertions.assertEquals("ocvvujexayglxrk", response.iterator().next().properties().properties().get("jnmzp")); - Assertions.assertEquals("ynhbokayrg", response.iterator().next().properties().tags().get("ybriop")); - Assertions.assertEquals(true, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions - .assertEquals( - AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.iterator().next().properties().autoRebuild()); - Assertions.assertEquals("yljurkeposehqqyl", response.iterator().next().properties().build().contextUri()); - Assertions.assertEquals("ctwjwdsdlzm", response.iterator().next().properties().build().dockerfilePath()); - Assertions.assertEquals("erxxxoteehkhowgo", response.iterator().next().properties().condaFile()); - Assertions.assertEquals("xowpcbapn", response.iterator().next().properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.iterator().next().properties().osType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java deleted file mode 100644 index 74cbfb4f49607..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import org.junit.jupiter.api.Assertions; - -public final class EstimatedVMPriceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EstimatedVMPrice model = - BinaryData - .fromString("{\"retailPrice\":57.931778810567735,\"osType\":\"Linux\",\"vmTier\":\"LowPriority\"}") - .toObject(EstimatedVMPrice.class); - Assertions.assertEquals(57.931778810567735, model.retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EstimatedVMPrice model = - new EstimatedVMPrice() - .withRetailPrice(57.931778810567735) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.LOW_PRIORITY); - model = BinaryData.fromObject(model).toObject(EstimatedVMPrice.class); - Assertions.assertEquals(57.931778810567735, model.retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java deleted file mode 100644 index 5af3ad025fa0c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EstimatedVMPricesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EstimatedVMPrices model = - BinaryData - .fromString( - "{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[{\"retailPrice\":45.736942050047844,\"osType\":\"Windows\",\"vmTier\":\"LowPriority\"}]}") - .toObject(EstimatedVMPrices.class); - Assertions.assertEquals(BillingCurrency.USD, model.billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.unitOfMeasure()); - Assertions.assertEquals(45.736942050047844, model.values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.WINDOWS, model.values().get(0).osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.values().get(0).vmTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EstimatedVMPrices model = - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues( - Arrays - .asList( - new EstimatedVMPrice() - .withRetailPrice(45.736942050047844) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.LOW_PRIORITY))); - model = BinaryData.fromObject(model).toObject(EstimatedVMPrices.class); - Assertions.assertEquals(BillingCurrency.USD, model.billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.unitOfMeasure()); - Assertions.assertEquals(45.736942050047844, model.values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.WINDOWS, model.values().get(0).osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.values().get(0).vmTier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java deleted file mode 100644 index a75cd9b0fcc19..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalFqdnResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalFqdnResponseInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"category\":\"jflcxog\",\"endpoints\":[]}},{\"properties\":{\"category\":\"nzmnsikvm\",\"endpoints\":[]}}]}") - .toObject(ExternalFqdnResponseInner.class); - Assertions.assertEquals("jflcxog", model.value().get(0).properties().category()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalFqdnResponseInner model = - new ExternalFqdnResponseInner() - .withValue( - Arrays - .asList( - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("jflcxog") - .withEndpoints(Arrays.asList())), - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("nzmnsikvm") - .withEndpoints(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(ExternalFqdnResponseInner.class); - Assertions.assertEquals("jflcxog", model.value().get(0).properties().category()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java deleted file mode 100644 index f57fccd72e815..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FeaturizationSettings; -import org.junit.jupiter.api.Assertions; - -public final class FeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"hwtbbaedorvvm\"}").toObject(FeaturizationSettings.class); - Assertions.assertEquals("hwtbbaedorvvm", model.datasetLanguage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FeaturizationSettings model = new FeaturizationSettings().withDatasetLanguage("hwtbbaedorvvm"); - model = BinaryData.fromObject(model).toObject(FeaturizationSettings.class); - Assertions.assertEquals("hwtbbaedorvvm", model.datasetLanguage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java deleted file mode 100644 index 11c126dd5b978..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class FlavorDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FlavorData model = - BinaryData - .fromString( - "{\"data\":{\"sdbccxjmonfdgnwn\":\"bdkelvidizo\",\"keifzzhmkdasv\":\"ypuuwwltvuqjctze\",\"cu\":\"lyhb\"}}") - .toObject(FlavorData.class); - Assertions.assertEquals("bdkelvidizo", model.data().get("sdbccxjmonfdgnwn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FlavorData model = - new FlavorData() - .withData(mapOf("sdbccxjmonfdgnwn", "bdkelvidizo", "keifzzhmkdasv", "ypuuwwltvuqjctze", "cu", "lyhb")); - model = BinaryData.fromObject(model).toObject(FlavorData.class); - Assertions.assertEquals("bdkelvidizo", model.data().get("sdbccxjmonfdgnwn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java deleted file mode 100644 index ba53d60d641c0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; - -public final class ForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastHorizon model = BinaryData.fromString("{\"mode\":\"ForecastHorizon\"}").toObject(ForecastHorizon.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastHorizon model = new ForecastHorizon(); - model = BinaryData.fromObject(model).toObject(ForecastHorizon.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java deleted file mode 100644 index bafd52e7516cd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FeatureLags; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; -import com.azure.resourcemanager.machinelearning.models.ForecastingSettings; -import com.azure.resourcemanager.machinelearning.models.Seasonality; -import com.azure.resourcemanager.machinelearning.models.ShortSeriesHandlingConfiguration; -import com.azure.resourcemanager.machinelearning.models.TargetAggregationFunction; -import com.azure.resourcemanager.machinelearning.models.TargetLags; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; -import com.azure.resourcemanager.machinelearning.models.UseStl; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastingSettings model = - BinaryData - .fromString( - "{\"countryOrRegionForHolidays\":\"thuqolyahluq\",\"cvStepSize\":608197313,\"featureLags\":\"Auto\",\"forecastHorizon\":{\"mode\":\"ForecastHorizon\"},\"frequency\":\"rjb\",\"seasonality\":{\"mode\":\"Seasonality\"},\"shortSeriesHandlingConfig\":\"None\",\"targetAggregateFunction\":\"None\",\"targetLags\":{\"mode\":\"TargetLags\"},\"targetRollingWindowSize\":{\"mode\":\"TargetRollingWindowSize\"},\"timeColumnName\":\"zvqqugdrftbcvexr\",\"timeSeriesIdColumnNames\":[\"uowtljvfwhrea\",\"khyxvrqtvbcz\",\"ulmdgglm\",\"pjpfseykgs\"],\"useStl\":\"Season\"}") - .toObject(ForecastingSettings.class); - Assertions.assertEquals("thuqolyahluq", model.countryOrRegionForHolidays()); - Assertions.assertEquals(608197313, model.cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.featureLags()); - Assertions.assertEquals("rjb", model.frequency()); - Assertions.assertEquals(ShortSeriesHandlingConfiguration.NONE, model.shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.NONE, model.targetAggregateFunction()); - Assertions.assertEquals("zvqqugdrftbcvexr", model.timeColumnName()); - Assertions.assertEquals("uowtljvfwhrea", model.timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.SEASON, model.useStl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastingSettings model = - new ForecastingSettings() - .withCountryOrRegionForHolidays("thuqolyahluq") - .withCvStepSize(608197313) - .withFeatureLags(FeatureLags.AUTO) - .withForecastHorizon(new ForecastHorizon()) - .withFrequency("rjb") - .withSeasonality(new Seasonality()) - .withShortSeriesHandlingConfig(ShortSeriesHandlingConfiguration.NONE) - .withTargetAggregateFunction(TargetAggregationFunction.NONE) - .withTargetLags(new TargetLags()) - .withTargetRollingWindowSize(new TargetRollingWindowSize()) - .withTimeColumnName("zvqqugdrftbcvexr") - .withTimeSeriesIdColumnNames(Arrays.asList("uowtljvfwhrea", "khyxvrqtvbcz", "ulmdgglm", "pjpfseykgs")) - .withUseStl(UseStl.SEASON); - model = BinaryData.fromObject(model).toObject(ForecastingSettings.class); - Assertions.assertEquals("thuqolyahluq", model.countryOrRegionForHolidays()); - Assertions.assertEquals(608197313, model.cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.featureLags()); - Assertions.assertEquals("rjb", model.frequency()); - Assertions.assertEquals(ShortSeriesHandlingConfiguration.NONE, model.shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.NONE, model.targetAggregateFunction()); - Assertions.assertEquals("zvqqugdrftbcvexr", model.timeColumnName()); - Assertions.assertEquals("uowtljvfwhrea", model.timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.SEASON, model.useStl()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java deleted file mode 100644 index 3a4e3ae50a89e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeatureLags; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; -import com.azure.resourcemanager.machinelearning.models.Forecasting; -import com.azure.resourcemanager.machinelearning.models.ForecastingModels; -import com.azure.resourcemanager.machinelearning.models.ForecastingPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.ForecastingSettings; -import com.azure.resourcemanager.machinelearning.models.ForecastingTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.Seasonality; -import com.azure.resourcemanager.machinelearning.models.ShortSeriesHandlingConfiguration; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TargetAggregationFunction; -import com.azure.resourcemanager.machinelearning.models.TargetLags; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; -import com.azure.resourcemanager.machinelearning.models.UseStl; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Forecasting model = - BinaryData - .fromString( - "{\"taskType\":\"Forecasting\",\"forecastingSettings\":{\"countryOrRegionForHolidays\":\"zxmdew\",\"cvStepSize\":1373177035,\"featureLags\":\"Auto\",\"forecastHorizon\":{\"mode\":\"ForecastHorizon\"},\"frequency\":\"lbjazejww\",\"seasonality\":{\"mode\":\"Seasonality\"},\"shortSeriesHandlingConfig\":\"Pad\",\"targetAggregateFunction\":\"Min\",\"targetLags\":{\"mode\":\"TargetLags\"},\"targetRollingWindowSize\":{\"mode\":\"TargetRollingWindowSize\"},\"timeColumnName\":\"brnnhjxsqw\",\"timeSeriesIdColumnNames\":[\"kbiwetpozyc\",\"qiqyhgfsetzlexbs\"],\"useStl\":\"None\"},\"primaryMetric\":\"R2Score\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"GradientBoosting\",\"SeasonalNaive\"],\"blockedTrainingAlgorithms\":[\"RandomForest\",\"Arimax\",\"Arimax\",\"Prophet\"],\"enableDnnTraining\":true,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT225H4M15S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datalpkpbafvafhl\",\"stackMetaLearnerTrainPercentage\":11.719010334787338,\"stackMetaLearnerType\":\"ElasticNet\"}},\"cvSplitColumnNames\":[\"xrhyzdfwrsofplt\"],\"featurizationSettings\":{\"blockedTransformers\":[\"WordEmbedding\",\"TextTargetEncoder\",\"TfIdf\",\"TfIdf\"],\"columnNameAndTypes\":{\"npq\":\"fnrac\",\"uuj\":\"g\"},\"enableDnnFeaturization\":false,\"mode\":\"Auto\",\"transformerParams\":{\"igrb\":[],\"xsjybvitvqk\":[],\"az\":[]},\"datasetLanguage\":\"mtggmu\"},\"limitSettings\":{\"enableEarlyTermination\":false,\"exitScore\":73.03774094829895,\"maxConcurrentTrials\":1401154430,\"maxCoresPerTrial\":737761166,\"maxTrials\":273920655,\"timeout\":\"PT29H11M39S\",\"trialTimeout\":\"PT238H15M11S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"voaiknaqlnuw\",\"description\":\"uyxlykwphvxzcw\"},\"testDataSize\":14.530784309792832,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"lkexaonwivkcqh\",\"description\":\"hxknlccrmmkyupi\"},\"validationDataSize\":89.69731810693186,\"weightColumnName\":\"jfkakfqfrke\",\"logVerbosity\":\"Error\",\"targetColumnName\":\"dudxjascowvfdjk\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"phlkksnm\",\"description\":\"vyfijdkzuqnw\"}}") - .toObject(Forecasting.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("dudxjascowvfdjk", model.targetColumnName()); - Assertions.assertEquals("vyfijdkzuqnw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("phlkksnm", model.trainingData().uri()); - Assertions.assertEquals("zxmdew", model.forecastingSettings().countryOrRegionForHolidays()); - Assertions.assertEquals(1373177035, model.forecastingSettings().cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.forecastingSettings().featureLags()); - Assertions.assertEquals("lbjazejww", model.forecastingSettings().frequency()); - Assertions - .assertEquals( - ShortSeriesHandlingConfiguration.PAD, model.forecastingSettings().shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.MIN, model.forecastingSettings().targetAggregateFunction()); - Assertions.assertEquals("brnnhjxsqw", model.forecastingSettings().timeColumnName()); - Assertions.assertEquals("kbiwetpozyc", model.forecastingSettings().timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.NONE, model.forecastingSettings().useStl()); - Assertions.assertEquals(ForecastingPrimaryMetrics.R2SCORE, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT225H4M15S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 11.719010334787338D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.ELASTIC_NET, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ForecastingModels.GRADIENT_BOOSTING, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals(ForecastingModels.RANDOM_FOREST, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("xrhyzdfwrsofplt", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mtggmu", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WORD_EMBEDDING, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("fnrac", model.featurizationSettings().columnNameAndTypes().get("npq")); - Assertions.assertEquals(false, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(73.03774094829895D, model.limitSettings().exitScore()); - Assertions.assertEquals(1401154430, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(737761166, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(273920655, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT29H11M39S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT238H15M11S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("uyxlykwphvxzcw", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("voaiknaqlnuw", model.testData().uri()); - Assertions.assertEquals(14.530784309792832D, model.testDataSize()); - Assertions.assertEquals("hxknlccrmmkyupi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("lkexaonwivkcqh", model.validationData().uri()); - Assertions.assertEquals(89.69731810693186D, model.validationDataSize()); - Assertions.assertEquals("jfkakfqfrke", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Forecasting model = - new Forecasting() - .withLogVerbosity(LogVerbosity.ERROR) - .withTargetColumnName("dudxjascowvfdjk") - .withTrainingData( - new MLTableJobInput() - .withDescription("vyfijdkzuqnw") - .withMode(InputDeliveryMode.DIRECT) - .withUri("phlkksnm")) - .withForecastingSettings( - new ForecastingSettings() - .withCountryOrRegionForHolidays("zxmdew") - .withCvStepSize(1373177035) - .withFeatureLags(FeatureLags.AUTO) - .withForecastHorizon(new ForecastHorizon()) - .withFrequency("lbjazejww") - .withSeasonality(new Seasonality()) - .withShortSeriesHandlingConfig(ShortSeriesHandlingConfiguration.PAD) - .withTargetAggregateFunction(TargetAggregationFunction.MIN) - .withTargetLags(new TargetLags()) - .withTargetRollingWindowSize(new TargetRollingWindowSize()) - .withTimeColumnName("brnnhjxsqw") - .withTimeSeriesIdColumnNames(Arrays.asList("kbiwetpozyc", "qiqyhgfsetzlexbs")) - .withUseStl(UseStl.NONE)) - .withPrimaryMetric(ForecastingPrimaryMetrics.R2SCORE) - .withTrainingSettings( - new ForecastingTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT225H4M15S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datalpkpbafvafhl") - .withStackMetaLearnerTrainPercentage(11.719010334787338D) - .withStackMetaLearnerType(StackMetaLearnerType.ELASTIC_NET)) - .withAllowedTrainingAlgorithms( - Arrays.asList(ForecastingModels.GRADIENT_BOOSTING, ForecastingModels.SEASONAL_NAIVE)) - .withBlockedTrainingAlgorithms( - Arrays - .asList( - ForecastingModels.RANDOM_FOREST, - ForecastingModels.ARIMAX, - ForecastingModels.ARIMAX, - ForecastingModels.PROPHET))) - .withCvSplitColumnNames(Arrays.asList("xrhyzdfwrsofplt")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("mtggmu") - .withBlockedTransformers( - Arrays - .asList( - BlockedTransformers.WORD_EMBEDDING, - BlockedTransformers.TEXT_TARGET_ENCODER, - BlockedTransformers.TF_IDF, - BlockedTransformers.TF_IDF)) - .withColumnNameAndTypes(mapOf("npq", "fnrac", "uuj", "g")) - .withEnableDnnFeaturization(false) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams( - mapOf("igrb", Arrays.asList(), "xsjybvitvqk", Arrays.asList(), "az", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(73.03774094829895D) - .withMaxConcurrentTrials(1401154430) - .withMaxCoresPerTrial(737761166) - .withMaxTrials(273920655) - .withTimeout(Duration.parse("PT29H11M39S")) - .withTrialTimeout(Duration.parse("PT238H15M11S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("uyxlykwphvxzcw") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("voaiknaqlnuw")) - .withTestDataSize(14.530784309792832D) - .withValidationData( - new MLTableJobInput() - .withDescription("hxknlccrmmkyupi") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("lkexaonwivkcqh")) - .withValidationDataSize(89.69731810693186D) - .withWeightColumnName("jfkakfqfrke"); - model = BinaryData.fromObject(model).toObject(Forecasting.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("dudxjascowvfdjk", model.targetColumnName()); - Assertions.assertEquals("vyfijdkzuqnw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("phlkksnm", model.trainingData().uri()); - Assertions.assertEquals("zxmdew", model.forecastingSettings().countryOrRegionForHolidays()); - Assertions.assertEquals(1373177035, model.forecastingSettings().cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.forecastingSettings().featureLags()); - Assertions.assertEquals("lbjazejww", model.forecastingSettings().frequency()); - Assertions - .assertEquals( - ShortSeriesHandlingConfiguration.PAD, model.forecastingSettings().shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.MIN, model.forecastingSettings().targetAggregateFunction()); - Assertions.assertEquals("brnnhjxsqw", model.forecastingSettings().timeColumnName()); - Assertions.assertEquals("kbiwetpozyc", model.forecastingSettings().timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.NONE, model.forecastingSettings().useStl()); - Assertions.assertEquals(ForecastingPrimaryMetrics.R2SCORE, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT225H4M15S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 11.719010334787338D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.ELASTIC_NET, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ForecastingModels.GRADIENT_BOOSTING, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals(ForecastingModels.RANDOM_FOREST, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("xrhyzdfwrsofplt", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mtggmu", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WORD_EMBEDDING, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("fnrac", model.featurizationSettings().columnNameAndTypes().get("npq")); - Assertions.assertEquals(false, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(73.03774094829895D, model.limitSettings().exitScore()); - Assertions.assertEquals(1401154430, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(737761166, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(273920655, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT29H11M39S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT238H15M11S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("uyxlykwphvxzcw", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("voaiknaqlnuw", model.testData().uri()); - Assertions.assertEquals(14.530784309792832D, model.testDataSize()); - Assertions.assertEquals("hxknlccrmmkyupi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("lkexaonwivkcqh", model.validationData().uri()); - Assertions.assertEquals(89.69731810693186D, model.validationDataSize()); - Assertions.assertEquals("jfkakfqfrke", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java deleted file mode 100644 index c87e4250da7bc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ForecastingModels; -import com.azure.resourcemanager.machinelearning.models.ForecastingTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastingTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"RandomForest\",\"TCNForecaster\",\"LightGBM\"],\"blockedTrainingAlgorithms\":[\"RandomForest\",\"Prophet\"],\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":true,\"ensembleModelDownloadTimeout\":\"PT217H25M43S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datadyedmzrgjfo\",\"stackMetaLearnerTrainPercentage\":17.660910285057906,\"stackMetaLearnerType\":\"LightGBMRegressor\"}}") - .toObject(ForecastingTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT217H25M43S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(17.660910285057906D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastingTrainingSettings model = - new ForecastingTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(true) - .withEnsembleModelDownloadTimeout(Duration.parse("PT217H25M43S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datadyedmzrgjfo") - .withStackMetaLearnerTrainPercentage(17.660910285057906D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms( - Arrays - .asList( - ForecastingModels.RANDOM_FOREST, - ForecastingModels.TCNFORECASTER, - ForecastingModels.LIGHT_GBM)) - .withBlockedTrainingAlgorithms( - Arrays.asList(ForecastingModels.RANDOM_FOREST, ForecastingModels.PROPHET)); - model = BinaryData.fromObject(model).toObject(ForecastingTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT217H25M43S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(17.660910285057906D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java deleted file mode 100644 index f09ae260cee0a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointDetail; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpointDetail model = BinaryData.fromString("{\"port\":1808760283}").toObject(FqdnEndpointDetail.class); - Assertions.assertEquals(1808760283, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpointDetail model = new FqdnEndpointDetail().withPort(1808760283); - model = BinaryData.fromObject(model).toObject(FqdnEndpointDetail.class); - Assertions.assertEquals(1808760283, model.port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java deleted file mode 100644 index 5a44acf3e5782..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpoint model = - BinaryData - .fromString( - "{\"domainName\":\"ievseotgqrllt\",\"endpointDetails\":[{\"port\":883294723},{\"port\":1914003848},{\"port\":779410918},{\"port\":1035303462}]}") - .toObject(FqdnEndpoint.class); - Assertions.assertEquals("ievseotgqrllt", model.domainName()); - Assertions.assertEquals(883294723, model.endpointDetails().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpoint model = - new FqdnEndpoint() - .withDomainName("ievseotgqrllt") - .withEndpointDetails( - Arrays - .asList( - new FqdnEndpointDetail().withPort(883294723), - new FqdnEndpointDetail().withPort(1914003848), - new FqdnEndpointDetail().withPort(779410918), - new FqdnEndpointDetail().withPort(1035303462))); - model = BinaryData.fromObject(model).toObject(FqdnEndpoint.class); - Assertions.assertEquals("ievseotgqrllt", model.domainName()); - Assertions.assertEquals(883294723, model.endpointDetails().get(0).port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java deleted file mode 100644 index d3543134f5a7c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpointsProperties model = - BinaryData - .fromString( - "{\"category\":\"qxn\",\"endpoints\":[{\"domainName\":\"gxhuriplbp\",\"endpointDetails\":[]},{\"domainName\":\"nkbebxmuby\",\"endpointDetails\":[]},{\"domainName\":\"lrb\",\"endpointDetails\":[]}]}") - .toObject(FqdnEndpointsProperties.class); - Assertions.assertEquals("qxn", model.category()); - Assertions.assertEquals("gxhuriplbp", model.endpoints().get(0).domainName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpointsProperties model = - new FqdnEndpointsProperties() - .withCategory("qxn") - .withEndpoints( - Arrays - .asList( - new FqdnEndpoint().withDomainName("gxhuriplbp").withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("nkbebxmuby").withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("lrb").withEndpointDetails(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(FqdnEndpointsProperties.class); - Assertions.assertEquals("qxn", model.category()); - Assertions.assertEquals("gxhuriplbp", model.endpoints().get(0).domainName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java deleted file mode 100644 index c2bc2b182d72f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpoints model = - BinaryData - .fromString( - "{\"properties\":{\"category\":\"qqkdltfzxmhhvhgu\",\"endpoints\":[{\"domainName\":\"kwobdagxtibq\",\"endpointDetails\":[]},{\"domainName\":\"xwak\",\"endpointDetails\":[]}]}}") - .toObject(FqdnEndpoints.class); - Assertions.assertEquals("qqkdltfzxmhhvhgu", model.properties().category()); - Assertions.assertEquals("kwobdagxtibq", model.properties().endpoints().get(0).domainName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpoints model = - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("qqkdltfzxmhhvhgu") - .withEndpoints( - Arrays - .asList( - new FqdnEndpoint() - .withDomainName("kwobdagxtibq") - .withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("xwak").withEndpointDetails(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(FqdnEndpoints.class); - Assertions.assertEquals("qqkdltfzxmhhvhgu", model.properties().category()); - Assertions.assertEquals("kwobdagxtibq", model.properties().endpoints().get(0).domainName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java deleted file mode 100644 index 451f4b5b2a136..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; - -public final class GridSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GridSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Grid\"}").toObject(GridSamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GridSamplingAlgorithm model = new GridSamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(GridSamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java deleted file mode 100644 index d070ba11cf157..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class IdAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"Id\",\"assetId\":\"itpkpztrgdg\"}") - .toObject(IdAssetReference.class); - Assertions.assertEquals("itpkpztrgdg", model.assetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdAssetReference model = new IdAssetReference().withAssetId("itpkpztrgdg"); - model = BinaryData.fromObject(model).toObject(IdAssetReference.class); - Assertions.assertEquals("itpkpztrgdg", model.assetId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java deleted file mode 100644 index e4457f12102bd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; - -public final class IdentityConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityConfiguration model = - BinaryData.fromString("{\"identityType\":\"IdentityConfiguration\"}").toObject(IdentityConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityConfiguration model = new IdentityConfiguration(); - model = BinaryData.fromObject(model).toObject(IdentityConfiguration.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java deleted file mode 100644 index 9ebb9969d0c24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityForCmk; -import org.junit.jupiter.api.Assertions; - -public final class IdentityForCmkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityForCmk model = - BinaryData.fromString("{\"userAssignedIdentity\":\"hanufhfcbjysagi\"}").toObject(IdentityForCmk.class); - Assertions.assertEquals("hanufhfcbjysagi", model.userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityForCmk model = new IdentityForCmk().withUserAssignedIdentity("hanufhfcbjysagi"); - model = BinaryData.fromObject(model).toObject(IdentityForCmk.class); - Assertions.assertEquals("hanufhfcbjysagi", model.userAssignedIdentity()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java deleted file mode 100644 index 2dbbce706d3a4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassificationBase; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassificationBase model = - BinaryData - .fromString( - "{\"modelSettings\":{\"trainingCropSize\":632161025,\"validationCropSize\":1319895932,\"validationResizeSize\":1773341425,\"weightedLoss\":2065297037,\"advancedSettings\":\"a\",\"amsGradient\":true,\"augmentations\":\"nhsenwphpzfng\",\"beta1\":24.413616,\"beta2\":87.05071,\"checkpointFrequency\":304312927,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"wjjufwbe\",\"description\":\"k\"},\"checkpointRunId\":\"rhtssr\",\"distributed\":false,\"earlyStopping\":true,\"earlyStoppingDelay\":1979060010,\"earlyStoppingPatience\":1774020224,\"enableOnnxNormalization\":true,\"evaluationFrequency\":853491099,\"gradientAccumulationStep\":1971606507,\"layersToFreeze\":323558985,\"learningRate\":42.430317,\"learningRateScheduler\":\"Step\",\"modelName\":\"zwxiytx\",\"momentum\":51.025497,\"nesterov\":true,\"numberOfEpochs\":1378257495,\"numberOfWorkers\":1753150962,\"optimizer\":\"Adam\",\"randomSeed\":1914645473,\"stepLRGamma\":97.39071,\"stepLRStepSize\":218117716,\"trainingBatchSize\":1079594168,\"validationBatchSize\":2132424945,\"warmupCosineLRCycles\":66.13355,\"warmupCosineLRWarmupEpochs\":568274703,\"weightDecay\":67.716774},\"searchSpace\":[{\"trainingCropSize\":\"egmmuteyxe\",\"validationCropSize\":\"uqi\",\"validationResizeSize\":\"jiitnspxlzdesygr\",\"weightedLoss\":\"waiufanra\",\"amsGradient\":\"fueqfrojs\",\"augmentations\":\"grhydk\",\"beta1\":\"ywezskiecafyg\",\"beta2\":\"xieqv\",\"distributed\":\"makli\",\"earlyStopping\":\"cahyhx\",\"earlyStoppingDelay\":\"ybxawoijpodtblx\",\"earlyStoppingPatience\":\"kwjdjodqhy\",\"enableOnnxNormalization\":\"ncn\",\"evaluationFrequency\":\"mehllizhceu\",\"gradientAccumulationStep\":\"qodkadppyibngql\",\"layersToFreeze\":\"ywrxw\",\"learningRate\":\"dtluvvadswzsn\",\"learningRateScheduler\":\"emlowuowhl\",\"modelName\":\"nwyrmouv\",\"momentum\":\"gmokzkltrfowt\",\"nesterov\":\"rfmvlihcvjdrqcrj\",\"numberOfEpochs\":\"h\",\"numberOfWorkers\":\"ukvhd\",\"optimizer\":\"wyojbfqzdkfnjyi\",\"randomSeed\":\"afr\",\"stepLRGamma\":\"qxmbjroumzzn\",\"stepLRStepSize\":\"l\",\"trainingBatchSize\":\"rhuzgfxonjtpu\",\"validationBatchSize\":\"l\",\"warmupCosineLRCycles\":\"pvti\",\"warmupCosineLRWarmupEpochs\":\"zbpdbo\",\"weightDecay\":\"gryfqiuasig\"},{\"trainingCropSize\":\"wsocnequygdjbo\",\"validationCropSize\":\"rmtqjkqevadr\",\"validationResizeSize\":\"wiu\",\"weightedLoss\":\"vcmjzkxiidisczsk\",\"amsGradient\":\"woqiqazugamxzkrr\",\"augmentations\":\"iisb\",\"beta1\":\"nppcce\",\"beta2\":\"ztdsbeza\",\"distributed\":\"f\",\"earlyStopping\":\"zxuizhyhnepkpe\",\"earlyStoppingDelay\":\"arxqiubx\",\"earlyStoppingPatience\":\"kecpxdazvdh\",\"enableOnnxNormalization\":\"mmkoszudb\",\"evaluationFrequency\":\"s\",\"gradientAccumulationStep\":\"rpcaqkiofkbtf\",\"layersToFreeze\":\"kl\",\"learningRate\":\"l\",\"learningRateScheduler\":\"vcb\",\"modelName\":\"ezyquw\",\"momentum\":\"qxutrpbrruyuua\",\"nesterov\":\"lmbjwcolbmxlbnw\",\"numberOfEpochs\":\"cpahprzrvxhm\",\"numberOfWorkers\":\"hocn\",\"optimizer\":\"cmj\",\"randomSeed\":\"gxnoqrxtdis\",\"stepLRGamma\":\"evhdlmydid\",\"stepLRStepSize\":\"epfwwt\",\"trainingBatchSize\":\"doesxxhmwcdb\",\"validationBatchSize\":\"yo\",\"warmupCosineLRCycles\":\"xkxhnegknjzrbhtm\",\"warmupCosineLRWarmupEpochs\":\"lvukaobrlb\",\"weightDecay\":\"snbagnchjhg\"},{\"trainingCropSize\":\"uowakyw\",\"validationCropSize\":\"hjym\",\"validationResizeSize\":\"gqtagd\",\"weightedLoss\":\"lss\",\"amsGradient\":\"jomevtfycnlb\",\"augmentations\":\"jcodkkgjiiytssi\",\"beta1\":\"z\",\"beta2\":\"ufqbvntnr\",\"distributed\":\"qsorh\",\"earlyStopping\":\"kxgnlykmxcpwzvmd\",\"earlyStoppingDelay\":\"sqdtiwlwxlbon\",\"earlyStoppingPatience\":\"bazqicqchygtvxby\",\"enableOnnxNormalization\":\"nepubdpkxyqvgx\",\"evaluationFrequency\":\"od\",\"gradientAccumulationStep\":\"vohkxdxuws\",\"layersToFreeze\":\"fmcwnosb\",\"learningRate\":\"ehgcvkbcknjo\",\"learningRateScheduler\":\"jy\",\"modelName\":\"pvelszerqze\",\"momentum\":\"o\",\"nesterov\":\"intxwa\",\"numberOfEpochs\":\"glzoblqwa\",\"numberOfWorkers\":\"r\",\"optimizer\":\"lhm\",\"randomSeed\":\"qb\",\"stepLRGamma\":\"vafjrqpjiyrqj\",\"stepLRStepSize\":\"gaxwmzwdfkbnrzo\",\"trainingBatchSize\":\"dltb\",\"validationBatchSize\":\"tqjfgxxsaet\",\"warmupCosineLRCycles\":\"dgvpyig\",\"warmupCosineLRWarmupEpochs\":\"qqil\",\"weightDecay\":\"cduwjoedx\"}],\"limitSettings\":{\"maxConcurrentTrials\":1780634429,\"maxTrials\":899036768,\"timeout\":\"PT30H59M40S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1408151149,\"evaluationInterval\":505810781},\"samplingAlgorithm\":\"Random\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"jqqacdmkx\",\"description\":\"dcvjwc\"},\"validationDataSize\":47.866367600253014}") - .toObject(ImageClassificationBase.class); - Assertions.assertEquals(1780634429, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(899036768, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT30H59M40S"), model.limitSettings().timeout()); - Assertions.assertEquals(1408151149, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(505810781, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("dcvjwc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("jqqacdmkx", model.validationData().uri()); - Assertions.assertEquals(47.866367600253014D, model.validationDataSize()); - Assertions.assertEquals("a", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("nhsenwphpzfng", model.modelSettings().augmentations()); - Assertions.assertEquals(24.413616F, model.modelSettings().beta1()); - Assertions.assertEquals(87.05071F, model.modelSettings().beta2()); - Assertions.assertEquals(304312927, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("k", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("wjjufwbe", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("rhtssr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1979060010, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1774020224, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(853491099, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1971606507, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(323558985, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(42.430317F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.STEP, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("zwxiytx", model.modelSettings().modelName()); - Assertions.assertEquals(51.025497F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(1378257495, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1753150962, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1914645473, model.modelSettings().randomSeed()); - Assertions.assertEquals(97.39071F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(218117716, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1079594168, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(2132424945, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(66.13355F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(568274703, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(67.716774F, model.modelSettings().weightDecay()); - Assertions.assertEquals(632161025, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(1319895932, model.modelSettings().validationCropSize()); - Assertions.assertEquals(1773341425, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(2065297037, model.modelSettings().weightedLoss()); - Assertions.assertEquals("fueqfrojs", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("grhydk", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("ywezskiecafyg", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("xieqv", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("makli", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("cahyhx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("ybxawoijpodtblx", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("kwjdjodqhy", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("ncn", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("mehllizhceu", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("qodkadppyibngql", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("ywrxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("dtluvvadswzsn", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("emlowuowhl", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("nwyrmouv", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("gmokzkltrfowt", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("rfmvlihcvjdrqcrj", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("h", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("ukvhd", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("wyojbfqzdkfnjyi", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("afr", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("qxmbjroumzzn", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("l", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("rhuzgfxonjtpu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("l", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("pvti", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("zbpdbo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("gryfqiuasig", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("egmmuteyxe", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("uqi", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("jiitnspxlzdesygr", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("waiufanra", model.searchSpace().get(0).weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassificationBase model = - new ImageClassificationBase() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1780634429) - .withMaxTrials(899036768) - .withTimeout(Duration.parse("PT30H59M40S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1408151149) - .withEvaluationInterval(505810781)) - .withSamplingAlgorithm(SamplingAlgorithmType.RANDOM)) - .withValidationData( - new MLTableJobInput() - .withDescription("dcvjwc") - .withMode(InputDeliveryMode.DIRECT) - .withUri("jqqacdmkx")) - .withValidationDataSize(47.866367600253014D) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("a") - .withAmsGradient(true) - .withAugmentations("nhsenwphpzfng") - .withBeta1(24.413616F) - .withBeta2(87.05071F) - .withCheckpointFrequency(304312927) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("k") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("wjjufwbe")) - .withCheckpointRunId("rhtssr") - .withDistributed(false) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1979060010) - .withEarlyStoppingPatience(1774020224) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(853491099) - .withGradientAccumulationStep(1971606507) - .withLayersToFreeze(323558985) - .withLearningRate(42.430317F) - .withLearningRateScheduler(LearningRateScheduler.STEP) - .withModelName("zwxiytx") - .withMomentum(51.025497F) - .withNesterov(true) - .withNumberOfEpochs(1378257495) - .withNumberOfWorkers(1753150962) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(1914645473) - .withStepLRGamma(97.39071F) - .withStepLRStepSize(218117716) - .withTrainingBatchSize(1079594168) - .withValidationBatchSize(2132424945) - .withWarmupCosineLRCycles(66.13355F) - .withWarmupCosineLRWarmupEpochs(568274703) - .withWeightDecay(67.716774F) - .withTrainingCropSize(632161025) - .withValidationCropSize(1319895932) - .withValidationResizeSize(1773341425) - .withWeightedLoss(2065297037)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("fueqfrojs") - .withAugmentations("grhydk") - .withBeta1("ywezskiecafyg") - .withBeta2("xieqv") - .withDistributed("makli") - .withEarlyStopping("cahyhx") - .withEarlyStoppingDelay("ybxawoijpodtblx") - .withEarlyStoppingPatience("kwjdjodqhy") - .withEnableOnnxNormalization("ncn") - .withEvaluationFrequency("mehllizhceu") - .withGradientAccumulationStep("qodkadppyibngql") - .withLayersToFreeze("ywrxw") - .withLearningRate("dtluvvadswzsn") - .withLearningRateScheduler("emlowuowhl") - .withModelName("nwyrmouv") - .withMomentum("gmokzkltrfowt") - .withNesterov("rfmvlihcvjdrqcrj") - .withNumberOfEpochs("h") - .withNumberOfWorkers("ukvhd") - .withOptimizer("wyojbfqzdkfnjyi") - .withRandomSeed("afr") - .withStepLRGamma("qxmbjroumzzn") - .withStepLRStepSize("l") - .withTrainingBatchSize("rhuzgfxonjtpu") - .withValidationBatchSize("l") - .withWarmupCosineLRCycles("pvti") - .withWarmupCosineLRWarmupEpochs("zbpdbo") - .withWeightDecay("gryfqiuasig") - .withTrainingCropSize("egmmuteyxe") - .withValidationCropSize("uqi") - .withValidationResizeSize("jiitnspxlzdesygr") - .withWeightedLoss("waiufanra"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("woqiqazugamxzkrr") - .withAugmentations("iisb") - .withBeta1("nppcce") - .withBeta2("ztdsbeza") - .withDistributed("f") - .withEarlyStopping("zxuizhyhnepkpe") - .withEarlyStoppingDelay("arxqiubx") - .withEarlyStoppingPatience("kecpxdazvdh") - .withEnableOnnxNormalization("mmkoszudb") - .withEvaluationFrequency("s") - .withGradientAccumulationStep("rpcaqkiofkbtf") - .withLayersToFreeze("kl") - .withLearningRate("l") - .withLearningRateScheduler("vcb") - .withModelName("ezyquw") - .withMomentum("qxutrpbrruyuua") - .withNesterov("lmbjwcolbmxlbnw") - .withNumberOfEpochs("cpahprzrvxhm") - .withNumberOfWorkers("hocn") - .withOptimizer("cmj") - .withRandomSeed("gxnoqrxtdis") - .withStepLRGamma("evhdlmydid") - .withStepLRStepSize("epfwwt") - .withTrainingBatchSize("doesxxhmwcdb") - .withValidationBatchSize("yo") - .withWarmupCosineLRCycles("xkxhnegknjzrbhtm") - .withWarmupCosineLRWarmupEpochs("lvukaobrlb") - .withWeightDecay("snbagnchjhg") - .withTrainingCropSize("wsocnequygdjbo") - .withValidationCropSize("rmtqjkqevadr") - .withValidationResizeSize("wiu") - .withWeightedLoss("vcmjzkxiidisczsk"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("jomevtfycnlb") - .withAugmentations("jcodkkgjiiytssi") - .withBeta1("z") - .withBeta2("ufqbvntnr") - .withDistributed("qsorh") - .withEarlyStopping("kxgnlykmxcpwzvmd") - .withEarlyStoppingDelay("sqdtiwlwxlbon") - .withEarlyStoppingPatience("bazqicqchygtvxby") - .withEnableOnnxNormalization("nepubdpkxyqvgx") - .withEvaluationFrequency("od") - .withGradientAccumulationStep("vohkxdxuws") - .withLayersToFreeze("fmcwnosb") - .withLearningRate("ehgcvkbcknjo") - .withLearningRateScheduler("jy") - .withModelName("pvelszerqze") - .withMomentum("o") - .withNesterov("intxwa") - .withNumberOfEpochs("glzoblqwa") - .withNumberOfWorkers("r") - .withOptimizer("lhm") - .withRandomSeed("qb") - .withStepLRGamma("vafjrqpjiyrqj") - .withStepLRStepSize("gaxwmzwdfkbnrzo") - .withTrainingBatchSize("dltb") - .withValidationBatchSize("tqjfgxxsaet") - .withWarmupCosineLRCycles("dgvpyig") - .withWarmupCosineLRWarmupEpochs("qqil") - .withWeightDecay("cduwjoedx") - .withTrainingCropSize("uowakyw") - .withValidationCropSize("hjym") - .withValidationResizeSize("gqtagd") - .withWeightedLoss("lss"))); - model = BinaryData.fromObject(model).toObject(ImageClassificationBase.class); - Assertions.assertEquals(1780634429, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(899036768, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT30H59M40S"), model.limitSettings().timeout()); - Assertions.assertEquals(1408151149, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(505810781, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("dcvjwc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("jqqacdmkx", model.validationData().uri()); - Assertions.assertEquals(47.866367600253014D, model.validationDataSize()); - Assertions.assertEquals("a", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("nhsenwphpzfng", model.modelSettings().augmentations()); - Assertions.assertEquals(24.413616F, model.modelSettings().beta1()); - Assertions.assertEquals(87.05071F, model.modelSettings().beta2()); - Assertions.assertEquals(304312927, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("k", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("wjjufwbe", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("rhtssr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1979060010, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1774020224, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(853491099, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1971606507, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(323558985, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(42.430317F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.STEP, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("zwxiytx", model.modelSettings().modelName()); - Assertions.assertEquals(51.025497F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(1378257495, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1753150962, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1914645473, model.modelSettings().randomSeed()); - Assertions.assertEquals(97.39071F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(218117716, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1079594168, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(2132424945, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(66.13355F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(568274703, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(67.716774F, model.modelSettings().weightDecay()); - Assertions.assertEquals(632161025, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(1319895932, model.modelSettings().validationCropSize()); - Assertions.assertEquals(1773341425, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(2065297037, model.modelSettings().weightedLoss()); - Assertions.assertEquals("fueqfrojs", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("grhydk", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("ywezskiecafyg", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("xieqv", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("makli", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("cahyhx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("ybxawoijpodtblx", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("kwjdjodqhy", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("ncn", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("mehllizhceu", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("qodkadppyibngql", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("ywrxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("dtluvvadswzsn", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("emlowuowhl", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("nwyrmouv", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("gmokzkltrfowt", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("rfmvlihcvjdrqcrj", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("h", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("ukvhd", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("wyojbfqzdkfnjyi", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("afr", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("qxmbjroumzzn", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("l", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("rhuzgfxonjtpu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("l", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("pvti", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("zbpdbo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("gryfqiuasig", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("egmmuteyxe", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("uqi", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("jiitnspxlzdesygr", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("waiufanra", model.searchSpace().get(0).weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java deleted file mode 100644 index 8e2df216288ff..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationMultilabelPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassificationMultilabel; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationMultilabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassificationMultilabel model = - BinaryData - .fromString( - "{\"taskType\":\"ImageClassificationMultilabel\",\"primaryMetric\":\"AUCWeighted\",\"modelSettings\":{\"trainingCropSize\":417240457,\"validationCropSize\":789963505,\"validationResizeSize\":69598333,\"weightedLoss\":1308483372,\"advancedSettings\":\"bjkdtfohf\",\"amsGradient\":true,\"augmentations\":\"vkiwrsiwdyjqu\",\"beta1\":22.829306,\"beta2\":15.07703,\"checkpointFrequency\":405607966,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"EvalMount\",\"uri\":\"kcsueho\",\"description\":\"dac\"},\"checkpointRunId\":\"bgydlqidywm\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":750629994,\"earlyStoppingPatience\":1002138354,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1214590834,\"gradientAccumulationStep\":1690234008,\"layersToFreeze\":541884766,\"learningRate\":83.81946,\"learningRateScheduler\":\"None\",\"modelName\":\"fnqt\",\"momentum\":10.774154,\"nesterov\":false,\"numberOfEpochs\":1583628489,\"numberOfWorkers\":10545664,\"optimizer\":\"Adamw\",\"randomSeed\":645986055,\"stepLRGamma\":13.888711,\"stepLRStepSize\":1004373323,\"trainingBatchSize\":1424628175,\"validationBatchSize\":1893405653,\"warmupCosineLRCycles\":73.06933,\"warmupCosineLRWarmupEpochs\":669991542,\"weightDecay\":8.02623},\"searchSpace\":[{\"trainingCropSize\":\"x\",\"validationCropSize\":\"vmywhsbrcarycsjj\",\"validationResizeSize\":\"voaqajuvehzptdmk\",\"weightedLoss\":\"bhmpfulubefgybp\",\"amsGradient\":\"bfununmpzkrv\",\"augmentations\":\"ifkdschlzvf\",\"beta1\":\"tnkjjwgcwnphb\",\"beta2\":\"fyrtogmhmjp\",\"distributed\":\"cdf\",\"earlyStopping\":\"qwtygevgwmseharx\",\"earlyStoppingDelay\":\"vqnrxtmbpj\",\"earlyStoppingPatience\":\"nvwjhrsidqpxl\",\"enableOnnxNormalization\":\"pakftngatwm\",\"evaluationFrequency\":\"yutrymd\",\"gradientAccumulationStep\":\"fj\",\"layersToFreeze\":\"y\",\"learningRate\":\"jqdvdwkqpldrlefg\",\"learningRateScheduler\":\"avuagnteta\",\"modelName\":\"tnpdctuhspfefy\",\"momentum\":\"duyeuyl\",\"nesterov\":\"hmtybkcgsuthhll\",\"numberOfEpochs\":\"wynefx\",\"numberOfWorkers\":\"lf\",\"optimizer\":\"atxtjrrlkmdskjhh\",\"randomSeed\":\"lajfoxcxscvslxlh\",\"stepLRGamma\":\"vkrmukmyjmkx\",\"stepLRStepSize\":\"tcsloj\",\"trainingBatchSize\":\"qid\",\"validationBatchSize\":\"toqxjh\",\"warmupCosineLRCycles\":\"csqhtkbtnqlrng\",\"warmupCosineLRWarmupEpochs\":\"mbiipsnawwlqk\",\"weightDecay\":\"xhhllxricct\"},{\"trainingCropSize\":\"muqqoajxei\",\"validationCropSize\":\"lesrwva\",\"validationResizeSize\":\"hdctrceqn\",\"weightedLoss\":\"rupobehd\",\"amsGradient\":\"jzacvumepjpbibn\",\"augmentations\":\"phepifexleqirc\",\"beta1\":\"cly\",\"beta2\":\"gxvrpjl\",\"distributed\":\"zuodacpun\",\"earlyStopping\":\"tepdjxqes\",\"earlyStoppingDelay\":\"ynu\",\"earlyStoppingPatience\":\"lpckaewsedves\",\"enableOnnxNormalization\":\"xegqphr\",\"evaluationFrequency\":\"nzhctmjtsgh\",\"gradientAccumulationStep\":\"c\",\"layersToFreeze\":\"pzarpzeqacdld\",\"learningRate\":\"mpypefcpczshnuq\",\"learningRateScheduler\":\"aizu\",\"modelName\":\"kh\",\"momentum\":\"tu\",\"nesterov\":\"xhmt\",\"numberOfEpochs\":\"vegwqiukvz\",\"numberOfWorkers\":\"dwttha\",\"optimizer\":\"gkskjivbss\",\"randomSeed\":\"jqf\",\"stepLRGamma\":\"peexpgeumilhwuit\",\"stepLRStepSize\":\"exyionofninbd\",\"trainingBatchSize\":\"s\",\"validationBatchSize\":\"wqqrsmpcbbprtuga\",\"warmupCosineLRCycles\":\"zbcyksiv\",\"warmupCosineLRWarmupEpochs\":\"ogd\",\"weightDecay\":\"bfcmkrfts\"},{\"trainingCropSize\":\"wjjxsgm\",\"validationCropSize\":\"wvif\",\"validationResizeSize\":\"kecifhocjxwklo\",\"weightedLoss\":\"rvtxvcmufunlc\",\"amsGradient\":\"xvi\",\"augmentations\":\"eyngjg\",\"beta1\":\"quv\",\"beta2\":\"gglpmcrdcuelj\",\"distributed\":\"ahxm\",\"earlyStopping\":\"ryarvsxzqb\",\"earlyStoppingDelay\":\"cjkay\",\"earlyStoppingPatience\":\"thzodubtlmjtgbl\",\"enableOnnxNormalization\":\"skkfmk\",\"evaluationFrequency\":\"djxyxgbkkqvjcteo\",\"gradientAccumulationStep\":\"l\",\"layersToFreeze\":\"lskkzpxvj\",\"learningRate\":\"dpvocojhpcn\",\"learningRateScheduler\":\"xzfsnggytexvzilm\",\"modelName\":\"vzkwwwncknr\",\"momentum\":\"ajlskzptj\",\"nesterov\":\"lwe\",\"numberOfEpochs\":\"yrth\",\"numberOfWorkers\":\"lehmcgcjeinueho\",\"optimizer\":\"mvfejvqnttmbqd\",\"randomSeed\":\"zfivfokpysthhzag\",\"stepLRGamma\":\"wyy\",\"stepLRStepSize\":\"hgenuzejgvkveb\",\"trainingBatchSize\":\"szllrzlsmmdqgmi\",\"validationBatchSize\":\"pimcqrhn\",\"warmupCosineLRCycles\":\"minkl\",\"warmupCosineLRWarmupEpochs\":\"xsvtzarhzvqnsqk\",\"weightDecay\":\"mbjwzzoslpkyb\"},{\"trainingCropSize\":\"lwkzpgajsqjcem\",\"validationCropSize\":\"mfuvqarwzxuqr\",\"validationResizeSize\":\"lui\",\"weightedLoss\":\"bwxsfgtdm\",\"amsGradient\":\"xekr\",\"augmentations\":\"k\",\"beta1\":\"budbt\",\"beta2\":\"okbavlyttaak\",\"distributed\":\"frkebsmhpd\",\"earlyStopping\":\"dig\",\"earlyStoppingDelay\":\"olekscbctnanqim\",\"earlyStoppingPatience\":\"zxpdcldpkawnsnl\",\"enableOnnxNormalization\":\"mouxwksqmudmfco\",\"evaluationFrequency\":\"icziuswswjrkb\",\"gradientAccumulationStep\":\"jhbtqq\",\"layersToFreeze\":\"fs\",\"learningRate\":\"rfwb\",\"learningRateScheduler\":\"qvogfuyz\",\"modelName\":\"bhli\",\"momentum\":\"yqe\",\"nesterov\":\"ood\",\"numberOfEpochs\":\"kcdrdaasaxxobsm\",\"numberOfWorkers\":\"wiyjvzuko\",\"optimizer\":\"nawnvz\",\"randomSeed\":\"n\",\"stepLRGamma\":\"ywsxvjabjqqaxu\",\"stepLRStepSize\":\"y\",\"trainingBatchSize\":\"nudn\",\"validationBatchSize\":\"abhjx\",\"warmupCosineLRCycles\":\"qweuip\",\"warmupCosineLRWarmupEpochs\":\"vk\",\"weightDecay\":\"itnsqxtltc\"}],\"limitSettings\":{\"maxConcurrentTrials\":2077569332,\"maxTrials\":49498731,\"timeout\":\"PT39H45M28S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1996640929,\"evaluationInterval\":1459369662},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"d\",\"description\":\"c\"},\"validationDataSize\":60.747284942704425,\"logVerbosity\":\"Debug\",\"targetColumnName\":\"rjajqmatxjtie\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"qgxxgfbb\",\"description\":\"lpqagyn\"}}") - .toObject(ImageClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("rjajqmatxjtie", model.targetColumnName()); - Assertions.assertEquals("lpqagyn", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("qgxxgfbb", model.trainingData().uri()); - Assertions.assertEquals(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED, model.primaryMetric()); - Assertions.assertEquals("bjkdtfohf", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("vkiwrsiwdyjqu", model.modelSettings().augmentations()); - Assertions.assertEquals(22.829306F, model.modelSettings().beta1()); - Assertions.assertEquals(15.07703F, model.modelSettings().beta2()); - Assertions.assertEquals(405607966, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("dac", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("kcsueho", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("bgydlqidywm", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(750629994, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1002138354, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1214590834, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1690234008, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(541884766, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(83.81946F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("fnqt", model.modelSettings().modelName()); - Assertions.assertEquals(10.774154F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1583628489, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(10545664, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(645986055, model.modelSettings().randomSeed()); - Assertions.assertEquals(13.888711F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1004373323, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1424628175, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1893405653, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(73.06933F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(669991542, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(8.02623F, model.modelSettings().weightDecay()); - Assertions.assertEquals(417240457, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(789963505, model.modelSettings().validationCropSize()); - Assertions.assertEquals(69598333, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(1308483372, model.modelSettings().weightedLoss()); - Assertions.assertEquals("bfununmpzkrv", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("ifkdschlzvf", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("tnkjjwgcwnphb", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("fyrtogmhmjp", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("cdf", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("qwtygevgwmseharx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vqnrxtmbpj", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("nvwjhrsidqpxl", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("pakftngatwm", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("yutrymd", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("fj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("y", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("jqdvdwkqpldrlefg", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("avuagnteta", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("tnpdctuhspfefy", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("duyeuyl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("hmtybkcgsuthhll", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("wynefx", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("lf", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("vkrmukmyjmkx", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("tcsloj", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("qid", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("toqxjh", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("csqhtkbtnqlrng", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("mbiipsnawwlqk", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("xhhllxricct", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("x", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("vmywhsbrcarycsjj", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("voaqajuvehzptdmk", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("bhmpfulubefgybp", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(2077569332, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(49498731, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT39H45M28S"), model.limitSettings().timeout()); - Assertions.assertEquals(1996640929, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1459369662, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("c", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("d", model.validationData().uri()); - Assertions.assertEquals(60.747284942704425D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassificationMultilabel model = - new ImageClassificationMultilabel() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("rjajqmatxjtie") - .withTrainingData( - new MLTableJobInput() - .withDescription("lpqagyn") - .withMode(InputDeliveryMode.DIRECT) - .withUri("qgxxgfbb")) - .withPrimaryMetric(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("bjkdtfohf") - .withAmsGradient(true) - .withAugmentations("vkiwrsiwdyjqu") - .withBeta1(22.829306F) - .withBeta2(15.07703F) - .withCheckpointFrequency(405607966) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("dac") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("kcsueho")) - .withCheckpointRunId("bgydlqidywm") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(750629994) - .withEarlyStoppingPatience(1002138354) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1214590834) - .withGradientAccumulationStep(1690234008) - .withLayersToFreeze(541884766) - .withLearningRate(83.81946F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("fnqt") - .withMomentum(10.774154F) - .withNesterov(false) - .withNumberOfEpochs(1583628489) - .withNumberOfWorkers(10545664) - .withOptimizer(StochasticOptimizer.ADAMW) - .withRandomSeed(645986055) - .withStepLRGamma(13.888711F) - .withStepLRStepSize(1004373323) - .withTrainingBatchSize(1424628175) - .withValidationBatchSize(1893405653) - .withWarmupCosineLRCycles(73.06933F) - .withWarmupCosineLRWarmupEpochs(669991542) - .withWeightDecay(8.02623F) - .withTrainingCropSize(417240457) - .withValidationCropSize(789963505) - .withValidationResizeSize(69598333) - .withWeightedLoss(1308483372)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("bfununmpzkrv") - .withAugmentations("ifkdschlzvf") - .withBeta1("tnkjjwgcwnphb") - .withBeta2("fyrtogmhmjp") - .withDistributed("cdf") - .withEarlyStopping("qwtygevgwmseharx") - .withEarlyStoppingDelay("vqnrxtmbpj") - .withEarlyStoppingPatience("nvwjhrsidqpxl") - .withEnableOnnxNormalization("pakftngatwm") - .withEvaluationFrequency("yutrymd") - .withGradientAccumulationStep("fj") - .withLayersToFreeze("y") - .withLearningRate("jqdvdwkqpldrlefg") - .withLearningRateScheduler("avuagnteta") - .withModelName("tnpdctuhspfefy") - .withMomentum("duyeuyl") - .withNesterov("hmtybkcgsuthhll") - .withNumberOfEpochs("wynefx") - .withNumberOfWorkers("lf") - .withOptimizer("atxtjrrlkmdskjhh") - .withRandomSeed("lajfoxcxscvslxlh") - .withStepLRGamma("vkrmukmyjmkx") - .withStepLRStepSize("tcsloj") - .withTrainingBatchSize("qid") - .withValidationBatchSize("toqxjh") - .withWarmupCosineLRCycles("csqhtkbtnqlrng") - .withWarmupCosineLRWarmupEpochs("mbiipsnawwlqk") - .withWeightDecay("xhhllxricct") - .withTrainingCropSize("x") - .withValidationCropSize("vmywhsbrcarycsjj") - .withValidationResizeSize("voaqajuvehzptdmk") - .withWeightedLoss("bhmpfulubefgybp"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("jzacvumepjpbibn") - .withAugmentations("phepifexleqirc") - .withBeta1("cly") - .withBeta2("gxvrpjl") - .withDistributed("zuodacpun") - .withEarlyStopping("tepdjxqes") - .withEarlyStoppingDelay("ynu") - .withEarlyStoppingPatience("lpckaewsedves") - .withEnableOnnxNormalization("xegqphr") - .withEvaluationFrequency("nzhctmjtsgh") - .withGradientAccumulationStep("c") - .withLayersToFreeze("pzarpzeqacdld") - .withLearningRate("mpypefcpczshnuq") - .withLearningRateScheduler("aizu") - .withModelName("kh") - .withMomentum("tu") - .withNesterov("xhmt") - .withNumberOfEpochs("vegwqiukvz") - .withNumberOfWorkers("dwttha") - .withOptimizer("gkskjivbss") - .withRandomSeed("jqf") - .withStepLRGamma("peexpgeumilhwuit") - .withStepLRStepSize("exyionofninbd") - .withTrainingBatchSize("s") - .withValidationBatchSize("wqqrsmpcbbprtuga") - .withWarmupCosineLRCycles("zbcyksiv") - .withWarmupCosineLRWarmupEpochs("ogd") - .withWeightDecay("bfcmkrfts") - .withTrainingCropSize("muqqoajxei") - .withValidationCropSize("lesrwva") - .withValidationResizeSize("hdctrceqn") - .withWeightedLoss("rupobehd"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("xvi") - .withAugmentations("eyngjg") - .withBeta1("quv") - .withBeta2("gglpmcrdcuelj") - .withDistributed("ahxm") - .withEarlyStopping("ryarvsxzqb") - .withEarlyStoppingDelay("cjkay") - .withEarlyStoppingPatience("thzodubtlmjtgbl") - .withEnableOnnxNormalization("skkfmk") - .withEvaluationFrequency("djxyxgbkkqvjcteo") - .withGradientAccumulationStep("l") - .withLayersToFreeze("lskkzpxvj") - .withLearningRate("dpvocojhpcn") - .withLearningRateScheduler("xzfsnggytexvzilm") - .withModelName("vzkwwwncknr") - .withMomentum("ajlskzptj") - .withNesterov("lwe") - .withNumberOfEpochs("yrth") - .withNumberOfWorkers("lehmcgcjeinueho") - .withOptimizer("mvfejvqnttmbqd") - .withRandomSeed("zfivfokpysthhzag") - .withStepLRGamma("wyy") - .withStepLRStepSize("hgenuzejgvkveb") - .withTrainingBatchSize("szllrzlsmmdqgmi") - .withValidationBatchSize("pimcqrhn") - .withWarmupCosineLRCycles("minkl") - .withWarmupCosineLRWarmupEpochs("xsvtzarhzvqnsqk") - .withWeightDecay("mbjwzzoslpkyb") - .withTrainingCropSize("wjjxsgm") - .withValidationCropSize("wvif") - .withValidationResizeSize("kecifhocjxwklo") - .withWeightedLoss("rvtxvcmufunlc"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("xekr") - .withAugmentations("k") - .withBeta1("budbt") - .withBeta2("okbavlyttaak") - .withDistributed("frkebsmhpd") - .withEarlyStopping("dig") - .withEarlyStoppingDelay("olekscbctnanqim") - .withEarlyStoppingPatience("zxpdcldpkawnsnl") - .withEnableOnnxNormalization("mouxwksqmudmfco") - .withEvaluationFrequency("icziuswswjrkb") - .withGradientAccumulationStep("jhbtqq") - .withLayersToFreeze("fs") - .withLearningRate("rfwb") - .withLearningRateScheduler("qvogfuyz") - .withModelName("bhli") - .withMomentum("yqe") - .withNesterov("ood") - .withNumberOfEpochs("kcdrdaasaxxobsm") - .withNumberOfWorkers("wiyjvzuko") - .withOptimizer("nawnvz") - .withRandomSeed("n") - .withStepLRGamma("ywsxvjabjqqaxu") - .withStepLRStepSize("y") - .withTrainingBatchSize("nudn") - .withValidationBatchSize("abhjx") - .withWarmupCosineLRCycles("qweuip") - .withWarmupCosineLRWarmupEpochs("vk") - .withWeightDecay("itnsqxtltc") - .withTrainingCropSize("lwkzpgajsqjcem") - .withValidationCropSize("mfuvqarwzxuqr") - .withValidationResizeSize("lui") - .withWeightedLoss("bwxsfgtdm"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(2077569332) - .withMaxTrials(49498731) - .withTimeout(Duration.parse("PT39H45M28S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1996640929) - .withEvaluationInterval(1459369662)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput().withDescription("c").withMode(InputDeliveryMode.EVAL_MOUNT).withUri("d")) - .withValidationDataSize(60.747284942704425D); - model = BinaryData.fromObject(model).toObject(ImageClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("rjajqmatxjtie", model.targetColumnName()); - Assertions.assertEquals("lpqagyn", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("qgxxgfbb", model.trainingData().uri()); - Assertions.assertEquals(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED, model.primaryMetric()); - Assertions.assertEquals("bjkdtfohf", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("vkiwrsiwdyjqu", model.modelSettings().augmentations()); - Assertions.assertEquals(22.829306F, model.modelSettings().beta1()); - Assertions.assertEquals(15.07703F, model.modelSettings().beta2()); - Assertions.assertEquals(405607966, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("dac", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("kcsueho", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("bgydlqidywm", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(750629994, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1002138354, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1214590834, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1690234008, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(541884766, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(83.81946F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("fnqt", model.modelSettings().modelName()); - Assertions.assertEquals(10.774154F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1583628489, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(10545664, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(645986055, model.modelSettings().randomSeed()); - Assertions.assertEquals(13.888711F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1004373323, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1424628175, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1893405653, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(73.06933F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(669991542, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(8.02623F, model.modelSettings().weightDecay()); - Assertions.assertEquals(417240457, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(789963505, model.modelSettings().validationCropSize()); - Assertions.assertEquals(69598333, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(1308483372, model.modelSettings().weightedLoss()); - Assertions.assertEquals("bfununmpzkrv", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("ifkdschlzvf", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("tnkjjwgcwnphb", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("fyrtogmhmjp", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("cdf", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("qwtygevgwmseharx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vqnrxtmbpj", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("nvwjhrsidqpxl", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("pakftngatwm", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("yutrymd", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("fj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("y", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("jqdvdwkqpldrlefg", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("avuagnteta", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("tnpdctuhspfefy", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("duyeuyl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("hmtybkcgsuthhll", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("wynefx", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("lf", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("vkrmukmyjmkx", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("tcsloj", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("qid", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("toqxjh", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("csqhtkbtnqlrng", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("mbiipsnawwlqk", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("xhhllxricct", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("x", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("vmywhsbrcarycsjj", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("voaqajuvehzptdmk", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("bhmpfulubefgybp", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(2077569332, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(49498731, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT39H45M28S"), model.limitSettings().timeout()); - Assertions.assertEquals(1996640929, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1459369662, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("c", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("d", model.validationData().uri()); - Assertions.assertEquals(60.747284942704425D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java deleted file mode 100644 index 7fd05a78c2d6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassification; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassification model = - BinaryData - .fromString( - "{\"taskType\":\"ImageClassification\",\"primaryMetric\":\"NormMacroRecall\",\"modelSettings\":{\"trainingCropSize\":857070249,\"validationCropSize\":372879313,\"validationResizeSize\":2040757308,\"weightedLoss\":601079141,\"advancedSettings\":\"pqitwe\",\"amsGradient\":false,\"augmentations\":\"vskbuhzacaq\",\"beta1\":35.776882,\"beta2\":7.5552106,\"checkpointFrequency\":1409246256,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"pdsxzakuejkm\",\"description\":\"iztjof\"},\"checkpointRunId\":\"vovjufycsjmlbe\",\"distributed\":false,\"earlyStopping\":true,\"earlyStoppingDelay\":1797904663,\"earlyStoppingPatience\":544161528,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1168175827,\"gradientAccumulationStep\":920753916,\"layersToFreeze\":979183363,\"learningRate\":75.56595,\"learningRateScheduler\":\"None\",\"modelName\":\"jfel\",\"momentum\":99.81994,\"nesterov\":true,\"numberOfEpochs\":902490226,\"numberOfWorkers\":1270842979,\"optimizer\":\"Adam\",\"randomSeed\":1405675230,\"stepLRGamma\":4.9547615,\"stepLRStepSize\":462800461,\"trainingBatchSize\":1308773307,\"validationBatchSize\":1918220645,\"warmupCosineLRCycles\":88.28787,\"warmupCosineLRWarmupEpochs\":1219612283,\"weightDecay\":35.093628},\"searchSpace\":[{\"trainingCropSize\":\"ccgzpraoxnyu\",\"validationCropSize\":\"a\",\"validationResizeSize\":\"gftipwc\",\"weightedLoss\":\"yubhiqdx\",\"amsGradient\":\"rnpnuhzafccnuh\",\"augmentations\":\"gbylbuig\",\"beta1\":\"vatvcrkd\",\"beta2\":\"nbqxvhcsyhzlwxae\",\"distributed\":\"vurex\",\"earlyStopping\":\"d\",\"earlyStoppingDelay\":\"dwead\",\"earlyStoppingPatience\":\"zmwntopagt\",\"enableOnnxNormalization\":\"v\",\"evaluationFrequency\":\"agoaqylkjztji\",\"gradientAccumulationStep\":\"zjcg\",\"layersToFreeze\":\"itpfinzcpdl\",\"learningRate\":\"rlgjm\",\"learningRateScheduler\":\"drvcqguef\",\"modelName\":\"ompheqdur\",\"momentum\":\"yujlfyoumpckyecl\",\"nesterov\":\"igptajbrzmqxucyc\",\"numberOfEpochs\":\"oclxiut\",\"numberOfWorkers\":\"cyzyzjdnrqjbt\",\"optimizer\":\"eaoqaqbzgyhf\",\"randomSeed\":\"v\",\"stepLRGamma\":\"tbwbqamteuli\",\"stepLRStepSize\":\"lpkcvmwfauxxep\",\"trainingBatchSize\":\"wbormcqmi\",\"validationBatchSize\":\"ijqpkzfbojxjmcs\",\"warmupCosineLRCycles\":\"qwixvcpwnk\",\"warmupCosineLRWarmupEpochs\":\"wzwofalickduo\",\"weightDecay\":\"tamtyv\"},{\"trainingCropSize\":\"nxrwzawnvs\",\"validationCropSize\":\"fhzag\",\"validationResizeSize\":\"vhycvdimwrzregzg\",\"weightedLoss\":\"futrwpweryekzkd\",\"amsGradient\":\"eotta\",\"augmentations\":\"yos\",\"beta1\":\"whnhjtfv\",\"beta2\":\"dpmiljpn\",\"distributed\":\"nudqllz\",\"earlyStopping\":\"uzpjlxeehux\",\"earlyStoppingDelay\":\"hzlraymezxlsk\",\"earlyStoppingPatience\":\"mxrfdsa\",\"enableOnnxNormalization\":\"ednwyyshtu\",\"evaluationFrequency\":\"mevuafpwzy\",\"gradientAccumulationStep\":\"rkgwltxeqip\",\"layersToFreeze\":\"zdyi\",\"learningRate\":\"fayorpravkjoges\",\"learningRateScheduler\":\"bnsmjkwynqxaek\",\"modelName\":\"ykvwjtqpkevmyltj\",\"momentum\":\"spxklu\",\"nesterov\":\"clf\",\"numberOfEpochs\":\"annnoytzposewx\",\"numberOfWorkers\":\"pxvkqma\",\"optimizer\":\"xvpif\",\"randomSeed\":\"aifyzyzeyuubeids\",\"stepLRGamma\":\"fytoi\",\"stepLRStepSize\":\"gygvfltgvdiho\",\"trainingBatchSize\":\"krxwet\",\"validationBatchSize\":\"drcyrucpcun\",\"warmupCosineLRCycles\":\"zdqumoe\",\"warmupCosineLRWarmupEpochs\":\"dnaienhqhskndnel\",\"weightDecay\":\"aadl\"},{\"trainingCropSize\":\"wf\",\"validationCropSize\":\"nniyopetxi\",\"validationResizeSize\":\"nrlyxnuc\",\"weightedLoss\":\"p\",\"amsGradient\":\"lkwq\",\"augmentations\":\"tv\",\"beta1\":\"sdtcjbctvivuzqym\",\"beta2\":\"owog\",\"distributed\":\"it\",\"earlyStopping\":\"hzvb\",\"earlyStoppingDelay\":\"cdb\",\"earlyStoppingPatience\":\"fzndscxmxeatkd\",\"enableOnnxNormalization\":\"wnrdjyibqbnaom\",\"evaluationFrequency\":\"rmkuh\",\"gradientAccumulationStep\":\"xljalfihc\",\"layersToFreeze\":\"obcancdexxqcw\",\"learningRate\":\"xf\",\"learningRateScheduler\":\"aknokzwjjzrl\",\"modelName\":\"xldzyyfytpqsix\",\"momentum\":\"m\",\"nesterov\":\"jivyqlkjuv\",\"numberOfEpochs\":\"bmslzoyov\",\"numberOfWorkers\":\"dbpqvybefgvm\",\"optimizer\":\"okcvtlubses\",\"randomSeed\":\"cua\",\"stepLRGamma\":\"rhunlp\",\"stepLRStepSize\":\"ykycndzfqi\",\"trainingBatchSize\":\"reuykbbmnwagl\",\"validationBatchSize\":\"xoe\",\"warmupCosineLRCycles\":\"nqlnfwmyymvqd\",\"warmupCosineLRWarmupEpochs\":\"bhfckdvezcrcssb\",\"weightDecay\":\"ddubbnqfblhkal\"}],\"limitSettings\":{\"maxConcurrentTrials\":1165708950,\"maxTrials\":893248980,\"timeout\":\"PT229H8M42S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":536414260,\"evaluationInterval\":693878843},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"gdmin\",\"description\":\"tteajohiygs\"},\"validationDataSize\":75.70753002197551,\"logVerbosity\":\"Debug\",\"targetColumnName\":\"czykmktpvw\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"sehch\",\"description\":\"ufmpqumqyjgy\"}}") - .toObject(ImageClassification.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("czykmktpvw", model.targetColumnName()); - Assertions.assertEquals("ufmpqumqyjgy", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("sehch", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.NORM_MACRO_RECALL, model.primaryMetric()); - Assertions.assertEquals("pqitwe", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("vskbuhzacaq", model.modelSettings().augmentations()); - Assertions.assertEquals(35.776882F, model.modelSettings().beta1()); - Assertions.assertEquals(7.5552106F, model.modelSettings().beta2()); - Assertions.assertEquals(1409246256, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("iztjof", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("pdsxzakuejkm", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("vovjufycsjmlbe", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1797904663, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(544161528, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1168175827, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(920753916, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(979183363, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(75.56595F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("jfel", model.modelSettings().modelName()); - Assertions.assertEquals(99.81994F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(902490226, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1270842979, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1405675230, model.modelSettings().randomSeed()); - Assertions.assertEquals(4.9547615F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(462800461, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1308773307, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1918220645, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(88.28787F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1219612283, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(35.093628F, model.modelSettings().weightDecay()); - Assertions.assertEquals(857070249, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(372879313, model.modelSettings().validationCropSize()); - Assertions.assertEquals(2040757308, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(601079141, model.modelSettings().weightedLoss()); - Assertions.assertEquals("rnpnuhzafccnuh", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("gbylbuig", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("vatvcrkd", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("nbqxvhcsyhzlwxae", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("vurex", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("d", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("dwead", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("zmwntopagt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("v", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("agoaqylkjztji", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("zjcg", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("itpfinzcpdl", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("rlgjm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("drvcqguef", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("ompheqdur", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("yujlfyoumpckyecl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("igptajbrzmqxucyc", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("oclxiut", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("cyzyzjdnrqjbt", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("eaoqaqbzgyhf", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("v", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("tbwbqamteuli", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("lpkcvmwfauxxep", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("wbormcqmi", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("ijqpkzfbojxjmcs", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("qwixvcpwnk", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("wzwofalickduo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("tamtyv", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("ccgzpraoxnyu", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("a", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("gftipwc", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("yubhiqdx", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(1165708950, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(893248980, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT229H8M42S"), model.limitSettings().timeout()); - Assertions.assertEquals(536414260, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(693878843, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("tteajohiygs", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("gdmin", model.validationData().uri()); - Assertions.assertEquals(75.70753002197551D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassification model = - new ImageClassification() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("czykmktpvw") - .withTrainingData( - new MLTableJobInput() - .withDescription("ufmpqumqyjgy") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("sehch")) - .withPrimaryMetric(ClassificationPrimaryMetrics.NORM_MACRO_RECALL) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("pqitwe") - .withAmsGradient(false) - .withAugmentations("vskbuhzacaq") - .withBeta1(35.776882F) - .withBeta2(7.5552106F) - .withCheckpointFrequency(1409246256) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("iztjof") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("pdsxzakuejkm")) - .withCheckpointRunId("vovjufycsjmlbe") - .withDistributed(false) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1797904663) - .withEarlyStoppingPatience(544161528) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1168175827) - .withGradientAccumulationStep(920753916) - .withLayersToFreeze(979183363) - .withLearningRate(75.56595F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("jfel") - .withMomentum(99.81994F) - .withNesterov(true) - .withNumberOfEpochs(902490226) - .withNumberOfWorkers(1270842979) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(1405675230) - .withStepLRGamma(4.9547615F) - .withStepLRStepSize(462800461) - .withTrainingBatchSize(1308773307) - .withValidationBatchSize(1918220645) - .withWarmupCosineLRCycles(88.28787F) - .withWarmupCosineLRWarmupEpochs(1219612283) - .withWeightDecay(35.093628F) - .withTrainingCropSize(857070249) - .withValidationCropSize(372879313) - .withValidationResizeSize(2040757308) - .withWeightedLoss(601079141)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("rnpnuhzafccnuh") - .withAugmentations("gbylbuig") - .withBeta1("vatvcrkd") - .withBeta2("nbqxvhcsyhzlwxae") - .withDistributed("vurex") - .withEarlyStopping("d") - .withEarlyStoppingDelay("dwead") - .withEarlyStoppingPatience("zmwntopagt") - .withEnableOnnxNormalization("v") - .withEvaluationFrequency("agoaqylkjztji") - .withGradientAccumulationStep("zjcg") - .withLayersToFreeze("itpfinzcpdl") - .withLearningRate("rlgjm") - .withLearningRateScheduler("drvcqguef") - .withModelName("ompheqdur") - .withMomentum("yujlfyoumpckyecl") - .withNesterov("igptajbrzmqxucyc") - .withNumberOfEpochs("oclxiut") - .withNumberOfWorkers("cyzyzjdnrqjbt") - .withOptimizer("eaoqaqbzgyhf") - .withRandomSeed("v") - .withStepLRGamma("tbwbqamteuli") - .withStepLRStepSize("lpkcvmwfauxxep") - .withTrainingBatchSize("wbormcqmi") - .withValidationBatchSize("ijqpkzfbojxjmcs") - .withWarmupCosineLRCycles("qwixvcpwnk") - .withWarmupCosineLRWarmupEpochs("wzwofalickduo") - .withWeightDecay("tamtyv") - .withTrainingCropSize("ccgzpraoxnyu") - .withValidationCropSize("a") - .withValidationResizeSize("gftipwc") - .withWeightedLoss("yubhiqdx"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("eotta") - .withAugmentations("yos") - .withBeta1("whnhjtfv") - .withBeta2("dpmiljpn") - .withDistributed("nudqllz") - .withEarlyStopping("uzpjlxeehux") - .withEarlyStoppingDelay("hzlraymezxlsk") - .withEarlyStoppingPatience("mxrfdsa") - .withEnableOnnxNormalization("ednwyyshtu") - .withEvaluationFrequency("mevuafpwzy") - .withGradientAccumulationStep("rkgwltxeqip") - .withLayersToFreeze("zdyi") - .withLearningRate("fayorpravkjoges") - .withLearningRateScheduler("bnsmjkwynqxaek") - .withModelName("ykvwjtqpkevmyltj") - .withMomentum("spxklu") - .withNesterov("clf") - .withNumberOfEpochs("annnoytzposewx") - .withNumberOfWorkers("pxvkqma") - .withOptimizer("xvpif") - .withRandomSeed("aifyzyzeyuubeids") - .withStepLRGamma("fytoi") - .withStepLRStepSize("gygvfltgvdiho") - .withTrainingBatchSize("krxwet") - .withValidationBatchSize("drcyrucpcun") - .withWarmupCosineLRCycles("zdqumoe") - .withWarmupCosineLRWarmupEpochs("dnaienhqhskndnel") - .withWeightDecay("aadl") - .withTrainingCropSize("nxrwzawnvs") - .withValidationCropSize("fhzag") - .withValidationResizeSize("vhycvdimwrzregzg") - .withWeightedLoss("futrwpweryekzkd"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("lkwq") - .withAugmentations("tv") - .withBeta1("sdtcjbctvivuzqym") - .withBeta2("owog") - .withDistributed("it") - .withEarlyStopping("hzvb") - .withEarlyStoppingDelay("cdb") - .withEarlyStoppingPatience("fzndscxmxeatkd") - .withEnableOnnxNormalization("wnrdjyibqbnaom") - .withEvaluationFrequency("rmkuh") - .withGradientAccumulationStep("xljalfihc") - .withLayersToFreeze("obcancdexxqcw") - .withLearningRate("xf") - .withLearningRateScheduler("aknokzwjjzrl") - .withModelName("xldzyyfytpqsix") - .withMomentum("m") - .withNesterov("jivyqlkjuv") - .withNumberOfEpochs("bmslzoyov") - .withNumberOfWorkers("dbpqvybefgvm") - .withOptimizer("okcvtlubses") - .withRandomSeed("cua") - .withStepLRGamma("rhunlp") - .withStepLRStepSize("ykycndzfqi") - .withTrainingBatchSize("reuykbbmnwagl") - .withValidationBatchSize("xoe") - .withWarmupCosineLRCycles("nqlnfwmyymvqd") - .withWarmupCosineLRWarmupEpochs("bhfckdvezcrcssb") - .withWeightDecay("ddubbnqfblhkal") - .withTrainingCropSize("wf") - .withValidationCropSize("nniyopetxi") - .withValidationResizeSize("nrlyxnuc") - .withWeightedLoss("p"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1165708950) - .withMaxTrials(893248980) - .withTimeout(Duration.parse("PT229H8M42S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(536414260) - .withEvaluationInterval(693878843)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput() - .withDescription("tteajohiygs") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("gdmin")) - .withValidationDataSize(75.70753002197551D); - model = BinaryData.fromObject(model).toObject(ImageClassification.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("czykmktpvw", model.targetColumnName()); - Assertions.assertEquals("ufmpqumqyjgy", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("sehch", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.NORM_MACRO_RECALL, model.primaryMetric()); - Assertions.assertEquals("pqitwe", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("vskbuhzacaq", model.modelSettings().augmentations()); - Assertions.assertEquals(35.776882F, model.modelSettings().beta1()); - Assertions.assertEquals(7.5552106F, model.modelSettings().beta2()); - Assertions.assertEquals(1409246256, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("iztjof", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("pdsxzakuejkm", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("vovjufycsjmlbe", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1797904663, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(544161528, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1168175827, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(920753916, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(979183363, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(75.56595F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("jfel", model.modelSettings().modelName()); - Assertions.assertEquals(99.81994F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(902490226, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1270842979, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1405675230, model.modelSettings().randomSeed()); - Assertions.assertEquals(4.9547615F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(462800461, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1308773307, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1918220645, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(88.28787F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1219612283, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(35.093628F, model.modelSettings().weightDecay()); - Assertions.assertEquals(857070249, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(372879313, model.modelSettings().validationCropSize()); - Assertions.assertEquals(2040757308, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(601079141, model.modelSettings().weightedLoss()); - Assertions.assertEquals("rnpnuhzafccnuh", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("gbylbuig", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("vatvcrkd", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("nbqxvhcsyhzlwxae", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("vurex", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("d", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("dwead", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("zmwntopagt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("v", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("agoaqylkjztji", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("zjcg", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("itpfinzcpdl", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("rlgjm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("drvcqguef", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("ompheqdur", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("yujlfyoumpckyecl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("igptajbrzmqxucyc", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("oclxiut", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("cyzyzjdnrqjbt", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("eaoqaqbzgyhf", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("v", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("tbwbqamteuli", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("lpkcvmwfauxxep", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("wbormcqmi", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("ijqpkzfbojxjmcs", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("qwixvcpwnk", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("wzwofalickduo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("tamtyv", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("ccgzpraoxnyu", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("a", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("gftipwc", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("yubhiqdx", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(1165708950, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(893248980, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT229H8M42S"), model.limitSettings().timeout()); - Assertions.assertEquals(536414260, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(693878843, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("tteajohiygs", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("gdmin", model.validationData().uri()); - Assertions.assertEquals(75.70753002197551D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java deleted file mode 100644 index 2f1c7507aca2c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageInstanceSegmentation; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.InstanceSegmentationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageInstanceSegmentationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageInstanceSegmentation model = - BinaryData - .fromString( - "{\"taskType\":\"ImageInstanceSegmentation\",\"primaryMetric\":\"MeanAveragePrecision\",\"modelSettings\":{\"boxDetectionsPerImage\":411999278,\"boxScoreThreshold\":18.429447,\"imageSize\":26955343,\"maxSize\":1642764526,\"minSize\":1482263286,\"modelSize\":\"Large\",\"multiScale\":false,\"nmsIouThreshold\":1.44642,\"tileGridSize\":\"ibmq\",\"tileOverlapRatio\":25.447088,\"tilePredictionsNmsThreshold\":69.32719,\"validationIouThreshold\":22.681719,\"validationMetricType\":\"CocoVoc\",\"advancedSettings\":\"u\",\"amsGradient\":false,\"augmentations\":\"etasvvoqsbp\",\"beta1\":60.15215,\"beta2\":97.623566,\"checkpointFrequency\":94750043,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"EvalDownload\",\"uri\":\"yao\",\"description\":\"zowpuohdkcprgukx\"},\"checkpointRunId\":\"tiochlutixmqr\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":917093220,\"earlyStoppingPatience\":1837159570,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1130120951,\"gradientAccumulationStep\":695678022,\"layersToFreeze\":1955906279,\"learningRate\":2.7083278,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"bcpaqktkrumzued\",\"momentum\":70.79762,\"nesterov\":false,\"numberOfEpochs\":306505202,\"numberOfWorkers\":886379161,\"optimizer\":\"Adam\",\"randomSeed\":113581490,\"stepLRGamma\":42.95044,\"stepLRStepSize\":1447634405,\"trainingBatchSize\":1828475728,\"validationBatchSize\":91831981,\"warmupCosineLRCycles\":61.42521,\"warmupCosineLRWarmupEpochs\":2131168360,\"weightDecay\":87.82275},\"searchSpace\":[{\"boxDetectionsPerImage\":\"qggjhf\",\"boxScoreThreshold\":\"xrqrkijpeuqlsd\",\"imageSize\":\"qztvx\",\"maxSize\":\"wwmjs\",\"minSize\":\"na\",\"modelSize\":\"amecle\",\"multiScale\":\"oulndhzyoeojhto\",\"nmsIouThreshold\":\"h\",\"tileGridSize\":\"idmytzln\",\"tileOverlapRatio\":\"xpno\",\"tilePredictionsNmsThreshold\":\"oanfbcswqagyw\",\"validationIouThreshold\":\"xigvjrktpgaeuk\",\"validationMetricType\":\"wohpmwhqnucs\",\"amsGradient\":\"hsidsjtdlpbnin\",\"augmentations\":\"azlsvbzfcpuo\",\"beta1\":\"dwjcciklhs\",\"beta2\":\"krdre\",\"distributed\":\"olr\",\"earlyStopping\":\"ehqbeivdlhydwbdb\",\"earlyStoppingDelay\":\"rlpunytjlkesmmpa\",\"earlyStoppingPatience\":\"ubt\",\"enableOnnxNormalization\":\"deani\",\"evaluationFrequency\":\"llbvgwzsfftedous\",\"gradientAccumulationStep\":\"tjtgravaqogfkb\",\"layersToFreeze\":\"auzlqbtxxw\",\"learningRate\":\"h\",\"learningRateScheduler\":\"zudrtpzk\",\"modelName\":\"eboywhczzqrhm\",\"momentum\":\"qbedygisrzwn\",\"nesterov\":\"d\",\"numberOfEpochs\":\"jch\",\"numberOfWorkers\":\"mpwctoflds\",\"optimizer\":\"cdhz\",\"randomSeed\":\"kbrfgdrwji\",\"stepLRGamma\":\"whfjsrwqrxe\",\"stepLRStepSize\":\"gcwvrrmdqntycna\",\"trainingBatchSize\":\"hvmaxgnuyeamcmhu\",\"validationBatchSize\":\"jecehokwc\",\"warmupCosineLRCycles\":\"twloesqr\",\"warmupCosineLRWarmupEpochs\":\"vrbnyrukoil\",\"weightDecay\":\"iduw\"}],\"limitSettings\":{\"maxConcurrentTrials\":111210342,\"maxTrials\":844410077,\"timeout\":\"PT37H28M23S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":814563749,\"evaluationInterval\":400227130},\"samplingAlgorithm\":\"Random\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"thqkkwhbgxvellv\",\"description\":\"nxdmnitmujdtv\"},\"validationDataSize\":82.02510999731906,\"logVerbosity\":\"NotSet\",\"targetColumnName\":\"fhmjp\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"yx\",\"description\":\"uvrzmzqmzjqrb\"}}") - .toObject(ImageInstanceSegmentation.class); - Assertions.assertEquals(LogVerbosity.NOT_SET, model.logVerbosity()); - Assertions.assertEquals("fhmjp", model.targetColumnName()); - Assertions.assertEquals("uvrzmzqmzjqrb", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("yx", model.trainingData().uri()); - Assertions.assertEquals(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("u", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("etasvvoqsbp", model.modelSettings().augmentations()); - Assertions.assertEquals(60.15215F, model.modelSettings().beta1()); - Assertions.assertEquals(97.623566F, model.modelSettings().beta2()); - Assertions.assertEquals(94750043, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("zowpuohdkcprgukx", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("yao", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("tiochlutixmqr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(917093220, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1837159570, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1130120951, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(695678022, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(1955906279, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(2.7083278F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("bcpaqktkrumzued", model.modelSettings().modelName()); - Assertions.assertEquals(70.79762F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(306505202, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(886379161, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(113581490, model.modelSettings().randomSeed()); - Assertions.assertEquals(42.95044F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1447634405, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1828475728, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(91831981, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(61.42521F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2131168360, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(87.82275F, model.modelSettings().weightDecay()); - Assertions.assertEquals(411999278, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(18.429447F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(26955343, model.modelSettings().imageSize()); - Assertions.assertEquals(1642764526, model.modelSettings().maxSize()); - Assertions.assertEquals(1482263286, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(1.44642F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("ibmq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(25.447088F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(69.32719F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(22.681719F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("hsidsjtdlpbnin", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("azlsvbzfcpuo", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("dwjcciklhs", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("krdre", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("olr", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("ehqbeivdlhydwbdb", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("rlpunytjlkesmmpa", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("ubt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("deani", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("llbvgwzsfftedous", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("tjtgravaqogfkb", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("auzlqbtxxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("h", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("zudrtpzk", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("eboywhczzqrhm", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("qbedygisrzwn", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("d", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("jch", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("mpwctoflds", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("cdhz", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("kbrfgdrwji", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("whfjsrwqrxe", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("gcwvrrmdqntycna", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("hvmaxgnuyeamcmhu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("jecehokwc", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("twloesqr", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("vrbnyrukoil", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("iduw", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("qggjhf", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("xrqrkijpeuqlsd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("qztvx", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("wwmjs", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("na", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("amecle", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("oulndhzyoeojhto", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("h", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("idmytzln", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpno", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("oanfbcswqagyw", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("xigvjrktpgaeuk", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("wohpmwhqnucs", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(111210342, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(844410077, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT37H28M23S"), model.limitSettings().timeout()); - Assertions.assertEquals(814563749, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(400227130, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nxdmnitmujdtv", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("thqkkwhbgxvellv", model.validationData().uri()); - Assertions.assertEquals(82.02510999731906D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageInstanceSegmentation model = - new ImageInstanceSegmentation() - .withLogVerbosity(LogVerbosity.NOT_SET) - .withTargetColumnName("fhmjp") - .withTrainingData( - new MLTableJobInput() - .withDescription("uvrzmzqmzjqrb") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("yx")) - .withPrimaryMetric(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("u") - .withAmsGradient(false) - .withAugmentations("etasvvoqsbp") - .withBeta1(60.15215F) - .withBeta2(97.623566F) - .withCheckpointFrequency(94750043) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("zowpuohdkcprgukx") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("yao")) - .withCheckpointRunId("tiochlutixmqr") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(917093220) - .withEarlyStoppingPatience(1837159570) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1130120951) - .withGradientAccumulationStep(695678022) - .withLayersToFreeze(1955906279) - .withLearningRate(2.7083278F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("bcpaqktkrumzued") - .withMomentum(70.79762F) - .withNesterov(false) - .withNumberOfEpochs(306505202) - .withNumberOfWorkers(886379161) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(113581490) - .withStepLRGamma(42.95044F) - .withStepLRStepSize(1447634405) - .withTrainingBatchSize(1828475728) - .withValidationBatchSize(91831981) - .withWarmupCosineLRCycles(61.42521F) - .withWarmupCosineLRWarmupEpochs(2131168360) - .withWeightDecay(87.82275F) - .withBoxDetectionsPerImage(411999278) - .withBoxScoreThreshold(18.429447F) - .withImageSize(26955343) - .withMaxSize(1642764526) - .withMinSize(1482263286) - .withModelSize(ModelSize.LARGE) - .withMultiScale(false) - .withNmsIouThreshold(1.44642F) - .withTileGridSize("ibmq") - .withTileOverlapRatio(25.447088F) - .withTilePredictionsNmsThreshold(69.32719F) - .withValidationIouThreshold(22.681719F) - .withValidationMetricType(ValidationMetricType.COCO_VOC)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("hsidsjtdlpbnin") - .withAugmentations("azlsvbzfcpuo") - .withBeta1("dwjcciklhs") - .withBeta2("krdre") - .withDistributed("olr") - .withEarlyStopping("ehqbeivdlhydwbdb") - .withEarlyStoppingDelay("rlpunytjlkesmmpa") - .withEarlyStoppingPatience("ubt") - .withEnableOnnxNormalization("deani") - .withEvaluationFrequency("llbvgwzsfftedous") - .withGradientAccumulationStep("tjtgravaqogfkb") - .withLayersToFreeze("auzlqbtxxw") - .withLearningRate("h") - .withLearningRateScheduler("zudrtpzk") - .withModelName("eboywhczzqrhm") - .withMomentum("qbedygisrzwn") - .withNesterov("d") - .withNumberOfEpochs("jch") - .withNumberOfWorkers("mpwctoflds") - .withOptimizer("cdhz") - .withRandomSeed("kbrfgdrwji") - .withStepLRGamma("whfjsrwqrxe") - .withStepLRStepSize("gcwvrrmdqntycna") - .withTrainingBatchSize("hvmaxgnuyeamcmhu") - .withValidationBatchSize("jecehokwc") - .withWarmupCosineLRCycles("twloesqr") - .withWarmupCosineLRWarmupEpochs("vrbnyrukoil") - .withWeightDecay("iduw") - .withBoxDetectionsPerImage("qggjhf") - .withBoxScoreThreshold("xrqrkijpeuqlsd") - .withImageSize("qztvx") - .withMaxSize("wwmjs") - .withMinSize("na") - .withModelSize("amecle") - .withMultiScale("oulndhzyoeojhto") - .withNmsIouThreshold("h") - .withTileGridSize("idmytzln") - .withTileOverlapRatio("xpno") - .withTilePredictionsNmsThreshold("oanfbcswqagyw") - .withValidationIouThreshold("xigvjrktpgaeuk") - .withValidationMetricType("wohpmwhqnucs"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(111210342) - .withMaxTrials(844410077) - .withTimeout(Duration.parse("PT37H28M23S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(814563749) - .withEvaluationInterval(400227130)) - .withSamplingAlgorithm(SamplingAlgorithmType.RANDOM)) - .withValidationData( - new MLTableJobInput() - .withDescription("nxdmnitmujdtv") - .withMode(InputDeliveryMode.DIRECT) - .withUri("thqkkwhbgxvellv")) - .withValidationDataSize(82.02510999731906D); - model = BinaryData.fromObject(model).toObject(ImageInstanceSegmentation.class); - Assertions.assertEquals(LogVerbosity.NOT_SET, model.logVerbosity()); - Assertions.assertEquals("fhmjp", model.targetColumnName()); - Assertions.assertEquals("uvrzmzqmzjqrb", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("yx", model.trainingData().uri()); - Assertions.assertEquals(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("u", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("etasvvoqsbp", model.modelSettings().augmentations()); - Assertions.assertEquals(60.15215F, model.modelSettings().beta1()); - Assertions.assertEquals(97.623566F, model.modelSettings().beta2()); - Assertions.assertEquals(94750043, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("zowpuohdkcprgukx", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("yao", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("tiochlutixmqr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(917093220, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1837159570, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1130120951, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(695678022, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(1955906279, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(2.7083278F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("bcpaqktkrumzued", model.modelSettings().modelName()); - Assertions.assertEquals(70.79762F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(306505202, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(886379161, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(113581490, model.modelSettings().randomSeed()); - Assertions.assertEquals(42.95044F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1447634405, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1828475728, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(91831981, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(61.42521F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2131168360, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(87.82275F, model.modelSettings().weightDecay()); - Assertions.assertEquals(411999278, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(18.429447F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(26955343, model.modelSettings().imageSize()); - Assertions.assertEquals(1642764526, model.modelSettings().maxSize()); - Assertions.assertEquals(1482263286, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(1.44642F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("ibmq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(25.447088F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(69.32719F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(22.681719F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("hsidsjtdlpbnin", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("azlsvbzfcpuo", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("dwjcciklhs", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("krdre", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("olr", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("ehqbeivdlhydwbdb", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("rlpunytjlkesmmpa", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("ubt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("deani", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("llbvgwzsfftedous", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("tjtgravaqogfkb", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("auzlqbtxxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("h", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("zudrtpzk", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("eboywhczzqrhm", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("qbedygisrzwn", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("d", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("jch", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("mpwctoflds", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("cdhz", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("kbrfgdrwji", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("whfjsrwqrxe", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("gcwvrrmdqntycna", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("hvmaxgnuyeamcmhu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("jecehokwc", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("twloesqr", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("vrbnyrukoil", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("iduw", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("qggjhf", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("xrqrkijpeuqlsd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("qztvx", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("wwmjs", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("na", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("amecle", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("oulndhzyoeojhto", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("h", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("idmytzln", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpno", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("oanfbcswqagyw", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("xigvjrktpgaeuk", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("wohpmwhqnucs", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(111210342, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(844410077, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT37H28M23S"), model.limitSettings().timeout()); - Assertions.assertEquals(814563749, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(400227130, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nxdmnitmujdtv", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("thqkkwhbgxvellv", model.validationData().uri()); - Assertions.assertEquals(82.02510999731906D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java deleted file mode 100644 index 6cb12aca74fbf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ImageLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageLimitSettings model = - BinaryData - .fromString("{\"maxConcurrentTrials\":543709562,\"maxTrials\":848455814,\"timeout\":\"PT224H41M46S\"}") - .toObject(ImageLimitSettings.class); - Assertions.assertEquals(543709562, model.maxConcurrentTrials()); - Assertions.assertEquals(848455814, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT224H41M46S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageLimitSettings model = - new ImageLimitSettings() - .withMaxConcurrentTrials(543709562) - .withMaxTrials(848455814) - .withTimeout(Duration.parse("PT224H41M46S")); - model = BinaryData.fromObject(model).toObject(ImageLimitSettings.class); - Assertions.assertEquals(543709562, model.maxConcurrentTrials()); - Assertions.assertEquals(848455814, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT224H41M46S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java deleted file mode 100644 index b8076b71567dc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettingsClassification model = - BinaryData - .fromString( - "{\"trainingCropSize\":\"jmfczlfsyqkf\",\"validationCropSize\":\"zgowox\",\"validationResizeSize\":\"je\",\"weightedLoss\":\"cxn\",\"amsGradient\":\"gxhlusr\",\"augmentations\":\"i\",\"beta1\":\"mjceagbjqvls\",\"beta2\":\"ywzash\",\"distributed\":\"onoyjf\",\"earlyStopping\":\"puby\",\"earlyStoppingDelay\":\"clkfkee\",\"earlyStoppingPatience\":\"vop\",\"enableOnnxNormalization\":\"tuoqujlyegqavni\",\"evaluationFrequency\":\"lqqbtnyjpylxdbfv\",\"gradientAccumulationStep\":\"mvmsxbae\",\"layersToFreeze\":\"jcnkottlwu\",\"learningRate\":\"ajmailfemjjza\",\"learningRateScheduler\":\"wjiqullqxb\",\"modelName\":\"vr\",\"momentum\":\"mqerndb\",\"nesterov\":\"yeofltfnnxrkad\",\"numberOfEpochs\":\"ynnfmuiii\",\"numberOfWorkers\":\"pfoh\",\"optimizer\":\"fkx\",\"randomSeed\":\"cbrwjiutgnjizbe\",\"stepLRGamma\":\"oiymrvzbjuyrsrzi\",\"stepLRStepSize\":\"tixgbd\",\"trainingBatchSize\":\"ifrevk\",\"validationBatchSize\":\"pezkis\",\"warmupCosineLRCycles\":\"jm\",\"warmupCosineLRWarmupEpochs\":\"hsyparybjuf\",\"weightDecay\":\"bjczjnciuiyqvlda\"}") - .toObject(ImageModelDistributionSettingsClassification.class); - Assertions.assertEquals("gxhlusr", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("mjceagbjqvls", model.beta1()); - Assertions.assertEquals("ywzash", model.beta2()); - Assertions.assertEquals("onoyjf", model.distributed()); - Assertions.assertEquals("puby", model.earlyStopping()); - Assertions.assertEquals("clkfkee", model.earlyStoppingDelay()); - Assertions.assertEquals("vop", model.earlyStoppingPatience()); - Assertions.assertEquals("tuoqujlyegqavni", model.enableOnnxNormalization()); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.evaluationFrequency()); - Assertions.assertEquals("mvmsxbae", model.gradientAccumulationStep()); - Assertions.assertEquals("jcnkottlwu", model.layersToFreeze()); - Assertions.assertEquals("ajmailfemjjza", model.learningRate()); - Assertions.assertEquals("wjiqullqxb", model.learningRateScheduler()); - Assertions.assertEquals("vr", model.modelName()); - Assertions.assertEquals("mqerndb", model.momentum()); - Assertions.assertEquals("yeofltfnnxrkad", model.nesterov()); - Assertions.assertEquals("ynnfmuiii", model.numberOfEpochs()); - Assertions.assertEquals("pfoh", model.numberOfWorkers()); - Assertions.assertEquals("fkx", model.optimizer()); - Assertions.assertEquals("cbrwjiutgnjizbe", model.randomSeed()); - Assertions.assertEquals("oiymrvzbjuyrsrzi", model.stepLRGamma()); - Assertions.assertEquals("tixgbd", model.stepLRStepSize()); - Assertions.assertEquals("ifrevk", model.trainingBatchSize()); - Assertions.assertEquals("pezkis", model.validationBatchSize()); - Assertions.assertEquals("jm", model.warmupCosineLRCycles()); - Assertions.assertEquals("hsyparybjuf", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("bjczjnciuiyqvlda", model.weightDecay()); - Assertions.assertEquals("jmfczlfsyqkf", model.trainingCropSize()); - Assertions.assertEquals("zgowox", model.validationCropSize()); - Assertions.assertEquals("je", model.validationResizeSize()); - Assertions.assertEquals("cxn", model.weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettingsClassification model = - new ImageModelDistributionSettingsClassification() - .withAmsGradient("gxhlusr") - .withAugmentations("i") - .withBeta1("mjceagbjqvls") - .withBeta2("ywzash") - .withDistributed("onoyjf") - .withEarlyStopping("puby") - .withEarlyStoppingDelay("clkfkee") - .withEarlyStoppingPatience("vop") - .withEnableOnnxNormalization("tuoqujlyegqavni") - .withEvaluationFrequency("lqqbtnyjpylxdbfv") - .withGradientAccumulationStep("mvmsxbae") - .withLayersToFreeze("jcnkottlwu") - .withLearningRate("ajmailfemjjza") - .withLearningRateScheduler("wjiqullqxb") - .withModelName("vr") - .withMomentum("mqerndb") - .withNesterov("yeofltfnnxrkad") - .withNumberOfEpochs("ynnfmuiii") - .withNumberOfWorkers("pfoh") - .withOptimizer("fkx") - .withRandomSeed("cbrwjiutgnjizbe") - .withStepLRGamma("oiymrvzbjuyrsrzi") - .withStepLRStepSize("tixgbd") - .withTrainingBatchSize("ifrevk") - .withValidationBatchSize("pezkis") - .withWarmupCosineLRCycles("jm") - .withWarmupCosineLRWarmupEpochs("hsyparybjuf") - .withWeightDecay("bjczjnciuiyqvlda") - .withTrainingCropSize("jmfczlfsyqkf") - .withValidationCropSize("zgowox") - .withValidationResizeSize("je") - .withWeightedLoss("cxn"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettingsClassification.class); - Assertions.assertEquals("gxhlusr", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("mjceagbjqvls", model.beta1()); - Assertions.assertEquals("ywzash", model.beta2()); - Assertions.assertEquals("onoyjf", model.distributed()); - Assertions.assertEquals("puby", model.earlyStopping()); - Assertions.assertEquals("clkfkee", model.earlyStoppingDelay()); - Assertions.assertEquals("vop", model.earlyStoppingPatience()); - Assertions.assertEquals("tuoqujlyegqavni", model.enableOnnxNormalization()); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.evaluationFrequency()); - Assertions.assertEquals("mvmsxbae", model.gradientAccumulationStep()); - Assertions.assertEquals("jcnkottlwu", model.layersToFreeze()); - Assertions.assertEquals("ajmailfemjjza", model.learningRate()); - Assertions.assertEquals("wjiqullqxb", model.learningRateScheduler()); - Assertions.assertEquals("vr", model.modelName()); - Assertions.assertEquals("mqerndb", model.momentum()); - Assertions.assertEquals("yeofltfnnxrkad", model.nesterov()); - Assertions.assertEquals("ynnfmuiii", model.numberOfEpochs()); - Assertions.assertEquals("pfoh", model.numberOfWorkers()); - Assertions.assertEquals("fkx", model.optimizer()); - Assertions.assertEquals("cbrwjiutgnjizbe", model.randomSeed()); - Assertions.assertEquals("oiymrvzbjuyrsrzi", model.stepLRGamma()); - Assertions.assertEquals("tixgbd", model.stepLRStepSize()); - Assertions.assertEquals("ifrevk", model.trainingBatchSize()); - Assertions.assertEquals("pezkis", model.validationBatchSize()); - Assertions.assertEquals("jm", model.warmupCosineLRCycles()); - Assertions.assertEquals("hsyparybjuf", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("bjczjnciuiyqvlda", model.weightDecay()); - Assertions.assertEquals("jmfczlfsyqkf", model.trainingCropSize()); - Assertions.assertEquals("zgowox", model.validationCropSize()); - Assertions.assertEquals("je", model.validationResizeSize()); - Assertions.assertEquals("cxn", model.weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java deleted file mode 100644 index 968465a57c12a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettingsObjectDetection model = - BinaryData - .fromString( - "{\"boxDetectionsPerImage\":\"isubxbteog\",\"boxScoreThreshold\":\"fiijrykwlefksxqc\",\"imageSize\":\"zfpxgnmqvzvluy\",\"maxSize\":\"aiossscyvaifp\",\"minSize\":\"acvfyeowps\",\"modelSize\":\"tjdhsoymhpvtyq\",\"multiScale\":\"tehdpboujs\",\"nmsIouThreshold\":\"fvvdshxcdedsue\",\"tileGridSize\":\"gnxcgjtfrnquktr\",\"tileOverlapRatio\":\"s\",\"tilePredictionsNmsThreshold\":\"lr\",\"validationIouThreshold\":\"myltrwntfmtbg\",\"validationMetricType\":\"dxwnazkurrd\",\"amsGradient\":\"yzjwhsetwwjwzzq\",\"augmentations\":\"uzu\",\"beta1\":\"y\",\"beta2\":\"yqhyqqzzdcykey\",\"distributed\":\"ewfopazdazg\",\"earlyStopping\":\"qgpewqcfutmdpvoz\",\"earlyStoppingDelay\":\"qjbknl\",\"earlyStoppingPatience\":\"lctzeyowmndcovd\",\"enableOnnxNormalization\":\"qauxzan\",\"evaluationFrequency\":\"kvfruwkudr\",\"gradientAccumulationStep\":\"pftxudqyeme\",\"layersToFreeze\":\"naucmcirtnee\",\"learningRate\":\"jauwcgxefnohaitr\",\"learningRateScheduler\":\"izerw\",\"modelName\":\"dasmxu\",\"momentum\":\"fbngfcocef\",\"nesterov\":\"riylfmpztra\",\"numberOfEpochs\":\"svhl\",\"numberOfWorkers\":\"culregpqt\",\"optimizer\":\"jhvrztnvgyshqrdg\",\"randomSeed\":\"wmewjzlpyk\",\"stepLRGamma\":\"azzwjcay\",\"stepLRStepSize\":\"zrransyb\",\"trainingBatchSize\":\"polwzrghsrlei\",\"validationBatchSize\":\"fscjfn\",\"warmupCosineLRCycles\":\"wvuagfqwtl\",\"warmupCosineLRWarmupEpochs\":\"gvmreuptrklzmi\",\"weightDecay\":\"jwolxfsvaghmpynw\"}") - .toObject(ImageModelDistributionSettingsObjectDetection.class); - Assertions.assertEquals("yzjwhsetwwjwzzq", model.amsGradient()); - Assertions.assertEquals("uzu", model.augmentations()); - Assertions.assertEquals("y", model.beta1()); - Assertions.assertEquals("yqhyqqzzdcykey", model.beta2()); - Assertions.assertEquals("ewfopazdazg", model.distributed()); - Assertions.assertEquals("qgpewqcfutmdpvoz", model.earlyStopping()); - Assertions.assertEquals("qjbknl", model.earlyStoppingDelay()); - Assertions.assertEquals("lctzeyowmndcovd", model.earlyStoppingPatience()); - Assertions.assertEquals("qauxzan", model.enableOnnxNormalization()); - Assertions.assertEquals("kvfruwkudr", model.evaluationFrequency()); - Assertions.assertEquals("pftxudqyeme", model.gradientAccumulationStep()); - Assertions.assertEquals("naucmcirtnee", model.layersToFreeze()); - Assertions.assertEquals("jauwcgxefnohaitr", model.learningRate()); - Assertions.assertEquals("izerw", model.learningRateScheduler()); - Assertions.assertEquals("dasmxu", model.modelName()); - Assertions.assertEquals("fbngfcocef", model.momentum()); - Assertions.assertEquals("riylfmpztra", model.nesterov()); - Assertions.assertEquals("svhl", model.numberOfEpochs()); - Assertions.assertEquals("culregpqt", model.numberOfWorkers()); - Assertions.assertEquals("jhvrztnvgyshqrdg", model.optimizer()); - Assertions.assertEquals("wmewjzlpyk", model.randomSeed()); - Assertions.assertEquals("azzwjcay", model.stepLRGamma()); - Assertions.assertEquals("zrransyb", model.stepLRStepSize()); - Assertions.assertEquals("polwzrghsrlei", model.trainingBatchSize()); - Assertions.assertEquals("fscjfn", model.validationBatchSize()); - Assertions.assertEquals("wvuagfqwtl", model.warmupCosineLRCycles()); - Assertions.assertEquals("gvmreuptrklzmi", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("jwolxfsvaghmpynw", model.weightDecay()); - Assertions.assertEquals("isubxbteog", model.boxDetectionsPerImage()); - Assertions.assertEquals("fiijrykwlefksxqc", model.boxScoreThreshold()); - Assertions.assertEquals("zfpxgnmqvzvluy", model.imageSize()); - Assertions.assertEquals("aiossscyvaifp", model.maxSize()); - Assertions.assertEquals("acvfyeowps", model.minSize()); - Assertions.assertEquals("tjdhsoymhpvtyq", model.modelSize()); - Assertions.assertEquals("tehdpboujs", model.multiScale()); - Assertions.assertEquals("fvvdshxcdedsue", model.nmsIouThreshold()); - Assertions.assertEquals("gnxcgjtfrnquktr", model.tileGridSize()); - Assertions.assertEquals("s", model.tileOverlapRatio()); - Assertions.assertEquals("lr", model.tilePredictionsNmsThreshold()); - Assertions.assertEquals("myltrwntfmtbg", model.validationIouThreshold()); - Assertions.assertEquals("dxwnazkurrd", model.validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettingsObjectDetection model = - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("yzjwhsetwwjwzzq") - .withAugmentations("uzu") - .withBeta1("y") - .withBeta2("yqhyqqzzdcykey") - .withDistributed("ewfopazdazg") - .withEarlyStopping("qgpewqcfutmdpvoz") - .withEarlyStoppingDelay("qjbknl") - .withEarlyStoppingPatience("lctzeyowmndcovd") - .withEnableOnnxNormalization("qauxzan") - .withEvaluationFrequency("kvfruwkudr") - .withGradientAccumulationStep("pftxudqyeme") - .withLayersToFreeze("naucmcirtnee") - .withLearningRate("jauwcgxefnohaitr") - .withLearningRateScheduler("izerw") - .withModelName("dasmxu") - .withMomentum("fbngfcocef") - .withNesterov("riylfmpztra") - .withNumberOfEpochs("svhl") - .withNumberOfWorkers("culregpqt") - .withOptimizer("jhvrztnvgyshqrdg") - .withRandomSeed("wmewjzlpyk") - .withStepLRGamma("azzwjcay") - .withStepLRStepSize("zrransyb") - .withTrainingBatchSize("polwzrghsrlei") - .withValidationBatchSize("fscjfn") - .withWarmupCosineLRCycles("wvuagfqwtl") - .withWarmupCosineLRWarmupEpochs("gvmreuptrklzmi") - .withWeightDecay("jwolxfsvaghmpynw") - .withBoxDetectionsPerImage("isubxbteog") - .withBoxScoreThreshold("fiijrykwlefksxqc") - .withImageSize("zfpxgnmqvzvluy") - .withMaxSize("aiossscyvaifp") - .withMinSize("acvfyeowps") - .withModelSize("tjdhsoymhpvtyq") - .withMultiScale("tehdpboujs") - .withNmsIouThreshold("fvvdshxcdedsue") - .withTileGridSize("gnxcgjtfrnquktr") - .withTileOverlapRatio("s") - .withTilePredictionsNmsThreshold("lr") - .withValidationIouThreshold("myltrwntfmtbg") - .withValidationMetricType("dxwnazkurrd"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettingsObjectDetection.class); - Assertions.assertEquals("yzjwhsetwwjwzzq", model.amsGradient()); - Assertions.assertEquals("uzu", model.augmentations()); - Assertions.assertEquals("y", model.beta1()); - Assertions.assertEquals("yqhyqqzzdcykey", model.beta2()); - Assertions.assertEquals("ewfopazdazg", model.distributed()); - Assertions.assertEquals("qgpewqcfutmdpvoz", model.earlyStopping()); - Assertions.assertEquals("qjbknl", model.earlyStoppingDelay()); - Assertions.assertEquals("lctzeyowmndcovd", model.earlyStoppingPatience()); - Assertions.assertEquals("qauxzan", model.enableOnnxNormalization()); - Assertions.assertEquals("kvfruwkudr", model.evaluationFrequency()); - Assertions.assertEquals("pftxudqyeme", model.gradientAccumulationStep()); - Assertions.assertEquals("naucmcirtnee", model.layersToFreeze()); - Assertions.assertEquals("jauwcgxefnohaitr", model.learningRate()); - Assertions.assertEquals("izerw", model.learningRateScheduler()); - Assertions.assertEquals("dasmxu", model.modelName()); - Assertions.assertEquals("fbngfcocef", model.momentum()); - Assertions.assertEquals("riylfmpztra", model.nesterov()); - Assertions.assertEquals("svhl", model.numberOfEpochs()); - Assertions.assertEquals("culregpqt", model.numberOfWorkers()); - Assertions.assertEquals("jhvrztnvgyshqrdg", model.optimizer()); - Assertions.assertEquals("wmewjzlpyk", model.randomSeed()); - Assertions.assertEquals("azzwjcay", model.stepLRGamma()); - Assertions.assertEquals("zrransyb", model.stepLRStepSize()); - Assertions.assertEquals("polwzrghsrlei", model.trainingBatchSize()); - Assertions.assertEquals("fscjfn", model.validationBatchSize()); - Assertions.assertEquals("wvuagfqwtl", model.warmupCosineLRCycles()); - Assertions.assertEquals("gvmreuptrklzmi", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("jwolxfsvaghmpynw", model.weightDecay()); - Assertions.assertEquals("isubxbteog", model.boxDetectionsPerImage()); - Assertions.assertEquals("fiijrykwlefksxqc", model.boxScoreThreshold()); - Assertions.assertEquals("zfpxgnmqvzvluy", model.imageSize()); - Assertions.assertEquals("aiossscyvaifp", model.maxSize()); - Assertions.assertEquals("acvfyeowps", model.minSize()); - Assertions.assertEquals("tjdhsoymhpvtyq", model.modelSize()); - Assertions.assertEquals("tehdpboujs", model.multiScale()); - Assertions.assertEquals("fvvdshxcdedsue", model.nmsIouThreshold()); - Assertions.assertEquals("gnxcgjtfrnquktr", model.tileGridSize()); - Assertions.assertEquals("s", model.tileOverlapRatio()); - Assertions.assertEquals("lr", model.tilePredictionsNmsThreshold()); - Assertions.assertEquals("myltrwntfmtbg", model.validationIouThreshold()); - Assertions.assertEquals("dxwnazkurrd", model.validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java deleted file mode 100644 index eff5f61e7e721..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettings; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettings model = - BinaryData - .fromString( - "{\"amsGradient\":\"v\",\"augmentations\":\"i\",\"beta1\":\"qzlgcndhzxrrfcfs\",\"beta2\":\"khgsnxuwwkpphefs\",\"distributed\":\"xlb\",\"earlyStopping\":\"omeikjcl\",\"earlyStoppingDelay\":\"acnmwpfsuqtaaz\",\"earlyStoppingPatience\":\"bxyxoy\",\"enableOnnxNormalization\":\"uqqiqezxlhd\",\"evaluationFrequency\":\"qdcadwvps\",\"gradientAccumulationStep\":\"j\",\"layersToFreeze\":\"hjriyb\",\"learningRate\":\"zo\",\"learningRateScheduler\":\"nxwdvwnjkg\",\"modelName\":\"nmx\",\"momentum\":\"rsqftib\",\"nesterov\":\"ibuyvpirf\",\"numberOfEpochs\":\"pnqn\",\"numberOfWorkers\":\"w\",\"optimizer\":\"edenrexkxbhxv\",\"randomSeed\":\"nul\",\"stepLRGamma\":\"nhj\",\"stepLRStepSize\":\"dyznfajsvks\",\"trainingBatchSize\":\"qozzkivyhjrliizj\",\"validationBatchSize\":\"lqfhefkwabs\",\"warmupCosineLRCycles\":\"ron\",\"warmupCosineLRWarmupEpochs\":\"lmgnlqxsjx\",\"weightDecay\":\"lexhv\"}") - .toObject(ImageModelDistributionSettings.class); - Assertions.assertEquals("v", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1()); - Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2()); - Assertions.assertEquals("xlb", model.distributed()); - Assertions.assertEquals("omeikjcl", model.earlyStopping()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay()); - Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience()); - Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization()); - Assertions.assertEquals("qdcadwvps", model.evaluationFrequency()); - Assertions.assertEquals("j", model.gradientAccumulationStep()); - Assertions.assertEquals("hjriyb", model.layersToFreeze()); - Assertions.assertEquals("zo", model.learningRate()); - Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler()); - Assertions.assertEquals("nmx", model.modelName()); - Assertions.assertEquals("rsqftib", model.momentum()); - Assertions.assertEquals("ibuyvpirf", model.nesterov()); - Assertions.assertEquals("pnqn", model.numberOfEpochs()); - Assertions.assertEquals("w", model.numberOfWorkers()); - Assertions.assertEquals("edenrexkxbhxv", model.optimizer()); - Assertions.assertEquals("nul", model.randomSeed()); - Assertions.assertEquals("nhj", model.stepLRGamma()); - Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize()); - Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize()); - Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize()); - Assertions.assertEquals("ron", model.warmupCosineLRCycles()); - Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("lexhv", model.weightDecay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettings model = - new ImageModelDistributionSettings() - .withAmsGradient("v") - .withAugmentations("i") - .withBeta1("qzlgcndhzxrrfcfs") - .withBeta2("khgsnxuwwkpphefs") - .withDistributed("xlb") - .withEarlyStopping("omeikjcl") - .withEarlyStoppingDelay("acnmwpfsuqtaaz") - .withEarlyStoppingPatience("bxyxoy") - .withEnableOnnxNormalization("uqqiqezxlhd") - .withEvaluationFrequency("qdcadwvps") - .withGradientAccumulationStep("j") - .withLayersToFreeze("hjriyb") - .withLearningRate("zo") - .withLearningRateScheduler("nxwdvwnjkg") - .withModelName("nmx") - .withMomentum("rsqftib") - .withNesterov("ibuyvpirf") - .withNumberOfEpochs("pnqn") - .withNumberOfWorkers("w") - .withOptimizer("edenrexkxbhxv") - .withRandomSeed("nul") - .withStepLRGamma("nhj") - .withStepLRStepSize("dyznfajsvks") - .withTrainingBatchSize("qozzkivyhjrliizj") - .withValidationBatchSize("lqfhefkwabs") - .withWarmupCosineLRCycles("ron") - .withWarmupCosineLRWarmupEpochs("lmgnlqxsjx") - .withWeightDecay("lexhv"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettings.class); - Assertions.assertEquals("v", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1()); - Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2()); - Assertions.assertEquals("xlb", model.distributed()); - Assertions.assertEquals("omeikjcl", model.earlyStopping()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay()); - Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience()); - Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization()); - Assertions.assertEquals("qdcadwvps", model.evaluationFrequency()); - Assertions.assertEquals("j", model.gradientAccumulationStep()); - Assertions.assertEquals("hjriyb", model.layersToFreeze()); - Assertions.assertEquals("zo", model.learningRate()); - Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler()); - Assertions.assertEquals("nmx", model.modelName()); - Assertions.assertEquals("rsqftib", model.momentum()); - Assertions.assertEquals("ibuyvpirf", model.nesterov()); - Assertions.assertEquals("pnqn", model.numberOfEpochs()); - Assertions.assertEquals("w", model.numberOfWorkers()); - Assertions.assertEquals("edenrexkxbhxv", model.optimizer()); - Assertions.assertEquals("nul", model.randomSeed()); - Assertions.assertEquals("nhj", model.stepLRGamma()); - Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize()); - Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize()); - Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize()); - Assertions.assertEquals("ron", model.warmupCosineLRCycles()); - Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("lexhv", model.weightDecay()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java deleted file mode 100644 index 5f68719c85e16..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettingsClassification model = - BinaryData - .fromString( - "{\"trainingCropSize\":1924497192,\"validationCropSize\":919883073,\"validationResizeSize\":1735818040,\"weightedLoss\":2030366014,\"advancedSettings\":\"tuicds\",\"amsGradient\":true,\"augmentations\":\"m\",\"beta1\":59.436913,\"beta2\":62.807377,\"checkpointFrequency\":1080891031,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"rgyngydgrpxnca\",\"description\":\"qao\"},\"checkpointRunId\":\"jrkc\",\"distributed\":true,\"earlyStopping\":true,\"earlyStoppingDelay\":1511007702,\"earlyStoppingPatience\":1521830595,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1183182643,\"gradientAccumulationStep\":588395160,\"layersToFreeze\":1092712252,\"learningRate\":63.37043,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"gxhqfgqkayejs\",\"momentum\":38.807606,\"nesterov\":true,\"numberOfEpochs\":390611386,\"numberOfWorkers\":883853554,\"optimizer\":\"None\",\"randomSeed\":9965556,\"stepLRGamma\":33.88037,\"stepLRStepSize\":1346771342,\"trainingBatchSize\":1977652281,\"validationBatchSize\":503751381,\"warmupCosineLRCycles\":23.360283,\"warmupCosineLRWarmupEpochs\":1142072535,\"weightDecay\":68.338776}") - .toObject(ImageModelSettingsClassification.class); - Assertions.assertEquals("tuicds", model.advancedSettings()); - Assertions.assertEquals(true, model.amsGradient()); - Assertions.assertEquals("m", model.augmentations()); - Assertions.assertEquals(59.436913F, model.beta1()); - Assertions.assertEquals(62.807377F, model.beta2()); - Assertions.assertEquals(1080891031, model.checkpointFrequency()); - Assertions.assertEquals("qao", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("rgyngydgrpxnca", model.checkpointModel().uri()); - Assertions.assertEquals("jrkc", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1511007702, model.earlyStoppingDelay()); - Assertions.assertEquals(1521830595, model.earlyStoppingPatience()); - Assertions.assertEquals(true, model.enableOnnxNormalization()); - Assertions.assertEquals(1183182643, model.evaluationFrequency()); - Assertions.assertEquals(588395160, model.gradientAccumulationStep()); - Assertions.assertEquals(1092712252, model.layersToFreeze()); - Assertions.assertEquals(63.37043F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("gxhqfgqkayejs", model.modelName()); - Assertions.assertEquals(38.807606F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(390611386, model.numberOfEpochs()); - Assertions.assertEquals(883853554, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(9965556, model.randomSeed()); - Assertions.assertEquals(33.88037F, model.stepLRGamma()); - Assertions.assertEquals(1346771342, model.stepLRStepSize()); - Assertions.assertEquals(1977652281, model.trainingBatchSize()); - Assertions.assertEquals(503751381, model.validationBatchSize()); - Assertions.assertEquals(23.360283F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1142072535, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(68.338776F, model.weightDecay()); - Assertions.assertEquals(1924497192, model.trainingCropSize()); - Assertions.assertEquals(919883073, model.validationCropSize()); - Assertions.assertEquals(1735818040, model.validationResizeSize()); - Assertions.assertEquals(2030366014, model.weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettingsClassification model = - new ImageModelSettingsClassification() - .withAdvancedSettings("tuicds") - .withAmsGradient(true) - .withAugmentations("m") - .withBeta1(59.436913F) - .withBeta2(62.807377F) - .withCheckpointFrequency(1080891031) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("qao") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("rgyngydgrpxnca")) - .withCheckpointRunId("jrkc") - .withDistributed(true) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1511007702) - .withEarlyStoppingPatience(1521830595) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1183182643) - .withGradientAccumulationStep(588395160) - .withLayersToFreeze(1092712252) - .withLearningRate(63.37043F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("gxhqfgqkayejs") - .withMomentum(38.807606F) - .withNesterov(true) - .withNumberOfEpochs(390611386) - .withNumberOfWorkers(883853554) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(9965556) - .withStepLRGamma(33.88037F) - .withStepLRStepSize(1346771342) - .withTrainingBatchSize(1977652281) - .withValidationBatchSize(503751381) - .withWarmupCosineLRCycles(23.360283F) - .withWarmupCosineLRWarmupEpochs(1142072535) - .withWeightDecay(68.338776F) - .withTrainingCropSize(1924497192) - .withValidationCropSize(919883073) - .withValidationResizeSize(1735818040) - .withWeightedLoss(2030366014); - model = BinaryData.fromObject(model).toObject(ImageModelSettingsClassification.class); - Assertions.assertEquals("tuicds", model.advancedSettings()); - Assertions.assertEquals(true, model.amsGradient()); - Assertions.assertEquals("m", model.augmentations()); - Assertions.assertEquals(59.436913F, model.beta1()); - Assertions.assertEquals(62.807377F, model.beta2()); - Assertions.assertEquals(1080891031, model.checkpointFrequency()); - Assertions.assertEquals("qao", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("rgyngydgrpxnca", model.checkpointModel().uri()); - Assertions.assertEquals("jrkc", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1511007702, model.earlyStoppingDelay()); - Assertions.assertEquals(1521830595, model.earlyStoppingPatience()); - Assertions.assertEquals(true, model.enableOnnxNormalization()); - Assertions.assertEquals(1183182643, model.evaluationFrequency()); - Assertions.assertEquals(588395160, model.gradientAccumulationStep()); - Assertions.assertEquals(1092712252, model.layersToFreeze()); - Assertions.assertEquals(63.37043F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("gxhqfgqkayejs", model.modelName()); - Assertions.assertEquals(38.807606F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(390611386, model.numberOfEpochs()); - Assertions.assertEquals(883853554, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(9965556, model.randomSeed()); - Assertions.assertEquals(33.88037F, model.stepLRGamma()); - Assertions.assertEquals(1346771342, model.stepLRStepSize()); - Assertions.assertEquals(1977652281, model.trainingBatchSize()); - Assertions.assertEquals(503751381, model.validationBatchSize()); - Assertions.assertEquals(23.360283F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1142072535, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(68.338776F, model.weightDecay()); - Assertions.assertEquals(1924497192, model.trainingCropSize()); - Assertions.assertEquals(919883073, model.validationCropSize()); - Assertions.assertEquals(1735818040, model.validationResizeSize()); - Assertions.assertEquals(2030366014, model.weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java deleted file mode 100644 index 71eeb63331538..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettingsObjectDetection model = - BinaryData - .fromString( - "{\"boxDetectionsPerImage\":101641984,\"boxScoreThreshold\":16.755789,\"imageSize\":1076058960,\"maxSize\":191759687,\"minSize\":1378586528,\"modelSize\":\"ExtraLarge\",\"multiScale\":true,\"nmsIouThreshold\":18.348568,\"tileGridSize\":\"ljzgdy\",\"tileOverlapRatio\":96.23886,\"tilePredictionsNmsThreshold\":36.949356,\"validationIouThreshold\":45.30077,\"validationMetricType\":\"CocoVoc\",\"advancedSettings\":\"rqhbjnqogdxwbsfp\",\"amsGradient\":false,\"augmentations\":\"jlf\",\"beta1\":75.122604,\"beta2\":77.73417,\"checkpointFrequency\":1341111685,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"jluxxdhi\",\"description\":\"zd\"},\"checkpointRunId\":\"qjm\",\"distributed\":false,\"earlyStopping\":false,\"earlyStoppingDelay\":954713869,\"earlyStoppingPatience\":1623513694,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1227246383,\"gradientAccumulationStep\":445418051,\"layersToFreeze\":1633383721,\"learningRate\":20.159918,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"znkcqwwxwjy\",\"momentum\":68.34347,\"nesterov\":true,\"numberOfEpochs\":370561675,\"numberOfWorkers\":561740795,\"optimizer\":\"None\",\"randomSeed\":1563473495,\"stepLRGamma\":32.891335,\"stepLRStepSize\":795985008,\"trainingBatchSize\":485145114,\"validationBatchSize\":638318099,\"warmupCosineLRCycles\":34.38207,\"warmupCosineLRWarmupEpochs\":771716822,\"weightDecay\":76.72818}") - .toObject(ImageModelSettingsObjectDetection.class); - Assertions.assertEquals("rqhbjnqogdxwbsfp", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("jlf", model.augmentations()); - Assertions.assertEquals(75.122604F, model.beta1()); - Assertions.assertEquals(77.73417F, model.beta2()); - Assertions.assertEquals(1341111685, model.checkpointFrequency()); - Assertions.assertEquals("zd", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("jluxxdhi", model.checkpointModel().uri()); - Assertions.assertEquals("qjm", model.checkpointRunId()); - Assertions.assertEquals(false, model.distributed()); - Assertions.assertEquals(false, model.earlyStopping()); - Assertions.assertEquals(954713869, model.earlyStoppingDelay()); - Assertions.assertEquals(1623513694, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(1227246383, model.evaluationFrequency()); - Assertions.assertEquals(445418051, model.gradientAccumulationStep()); - Assertions.assertEquals(1633383721, model.layersToFreeze()); - Assertions.assertEquals(20.159918F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("znkcqwwxwjy", model.modelName()); - Assertions.assertEquals(68.34347F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(370561675, model.numberOfEpochs()); - Assertions.assertEquals(561740795, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(1563473495, model.randomSeed()); - Assertions.assertEquals(32.891335F, model.stepLRGamma()); - Assertions.assertEquals(795985008, model.stepLRStepSize()); - Assertions.assertEquals(485145114, model.trainingBatchSize()); - Assertions.assertEquals(638318099, model.validationBatchSize()); - Assertions.assertEquals(34.38207F, model.warmupCosineLRCycles()); - Assertions.assertEquals(771716822, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(76.72818F, model.weightDecay()); - Assertions.assertEquals(101641984, model.boxDetectionsPerImage()); - Assertions.assertEquals(16.755789F, model.boxScoreThreshold()); - Assertions.assertEquals(1076058960, model.imageSize()); - Assertions.assertEquals(191759687, model.maxSize()); - Assertions.assertEquals(1378586528, model.minSize()); - Assertions.assertEquals(ModelSize.EXTRA_LARGE, model.modelSize()); - Assertions.assertEquals(true, model.multiScale()); - Assertions.assertEquals(18.348568F, model.nmsIouThreshold()); - Assertions.assertEquals("ljzgdy", model.tileGridSize()); - Assertions.assertEquals(96.23886F, model.tileOverlapRatio()); - Assertions.assertEquals(36.949356F, model.tilePredictionsNmsThreshold()); - Assertions.assertEquals(45.30077F, model.validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettingsObjectDetection model = - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("rqhbjnqogdxwbsfp") - .withAmsGradient(false) - .withAugmentations("jlf") - .withBeta1(75.122604F) - .withBeta2(77.73417F) - .withCheckpointFrequency(1341111685) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("zd") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("jluxxdhi")) - .withCheckpointRunId("qjm") - .withDistributed(false) - .withEarlyStopping(false) - .withEarlyStoppingDelay(954713869) - .withEarlyStoppingPatience(1623513694) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1227246383) - .withGradientAccumulationStep(445418051) - .withLayersToFreeze(1633383721) - .withLearningRate(20.159918F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("znkcqwwxwjy") - .withMomentum(68.34347F) - .withNesterov(true) - .withNumberOfEpochs(370561675) - .withNumberOfWorkers(561740795) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(1563473495) - .withStepLRGamma(32.891335F) - .withStepLRStepSize(795985008) - .withTrainingBatchSize(485145114) - .withValidationBatchSize(638318099) - .withWarmupCosineLRCycles(34.38207F) - .withWarmupCosineLRWarmupEpochs(771716822) - .withWeightDecay(76.72818F) - .withBoxDetectionsPerImage(101641984) - .withBoxScoreThreshold(16.755789F) - .withImageSize(1076058960) - .withMaxSize(191759687) - .withMinSize(1378586528) - .withModelSize(ModelSize.EXTRA_LARGE) - .withMultiScale(true) - .withNmsIouThreshold(18.348568F) - .withTileGridSize("ljzgdy") - .withTileOverlapRatio(96.23886F) - .withTilePredictionsNmsThreshold(36.949356F) - .withValidationIouThreshold(45.30077F) - .withValidationMetricType(ValidationMetricType.COCO_VOC); - model = BinaryData.fromObject(model).toObject(ImageModelSettingsObjectDetection.class); - Assertions.assertEquals("rqhbjnqogdxwbsfp", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("jlf", model.augmentations()); - Assertions.assertEquals(75.122604F, model.beta1()); - Assertions.assertEquals(77.73417F, model.beta2()); - Assertions.assertEquals(1341111685, model.checkpointFrequency()); - Assertions.assertEquals("zd", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("jluxxdhi", model.checkpointModel().uri()); - Assertions.assertEquals("qjm", model.checkpointRunId()); - Assertions.assertEquals(false, model.distributed()); - Assertions.assertEquals(false, model.earlyStopping()); - Assertions.assertEquals(954713869, model.earlyStoppingDelay()); - Assertions.assertEquals(1623513694, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(1227246383, model.evaluationFrequency()); - Assertions.assertEquals(445418051, model.gradientAccumulationStep()); - Assertions.assertEquals(1633383721, model.layersToFreeze()); - Assertions.assertEquals(20.159918F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("znkcqwwxwjy", model.modelName()); - Assertions.assertEquals(68.34347F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(370561675, model.numberOfEpochs()); - Assertions.assertEquals(561740795, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(1563473495, model.randomSeed()); - Assertions.assertEquals(32.891335F, model.stepLRGamma()); - Assertions.assertEquals(795985008, model.stepLRStepSize()); - Assertions.assertEquals(485145114, model.trainingBatchSize()); - Assertions.assertEquals(638318099, model.validationBatchSize()); - Assertions.assertEquals(34.38207F, model.warmupCosineLRCycles()); - Assertions.assertEquals(771716822, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(76.72818F, model.weightDecay()); - Assertions.assertEquals(101641984, model.boxDetectionsPerImage()); - Assertions.assertEquals(16.755789F, model.boxScoreThreshold()); - Assertions.assertEquals(1076058960, model.imageSize()); - Assertions.assertEquals(191759687, model.maxSize()); - Assertions.assertEquals(1378586528, model.minSize()); - Assertions.assertEquals(ModelSize.EXTRA_LARGE, model.modelSize()); - Assertions.assertEquals(true, model.multiScale()); - Assertions.assertEquals(18.348568F, model.nmsIouThreshold()); - Assertions.assertEquals("ljzgdy", model.tileGridSize()); - Assertions.assertEquals(96.23886F, model.tileOverlapRatio()); - Assertions.assertEquals(36.949356F, model.tilePredictionsNmsThreshold()); - Assertions.assertEquals(45.30077F, model.validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java deleted file mode 100644 index 432642cac511b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettings model = - BinaryData - .fromString( - "{\"advancedSettings\":\"va\",\"amsGradient\":false,\"augmentations\":\"zknxkv\",\"beta1\":37.521465,\"beta2\":75.73106,\"checkpointFrequency\":2099620376,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"mignohikkg\",\"description\":\"g\"},\"checkpointRunId\":\"pinde\",\"distributed\":true,\"earlyStopping\":true,\"earlyStoppingDelay\":1931875786,\"earlyStoppingPatience\":1421822703,\"enableOnnxNormalization\":false,\"evaluationFrequency\":785027108,\"gradientAccumulationStep\":332997027,\"layersToFreeze\":1895771662,\"learningRate\":85.75601,\"learningRateScheduler\":\"None\",\"modelName\":\"zir\",\"momentum\":31.809593,\"nesterov\":true,\"numberOfEpochs\":1519861948,\"numberOfWorkers\":833365863,\"optimizer\":\"None\",\"randomSeed\":688700290,\"stepLRGamma\":36.495888,\"stepLRStepSize\":829672692,\"trainingBatchSize\":1420035701,\"validationBatchSize\":450644888,\"warmupCosineLRCycles\":51.71764,\"warmupCosineLRWarmupEpochs\":1150687421,\"weightDecay\":80.28705}") - .toObject(ImageModelSettings.class); - Assertions.assertEquals("va", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("zknxkv", model.augmentations()); - Assertions.assertEquals(37.521465F, model.beta1()); - Assertions.assertEquals(75.73106F, model.beta2()); - Assertions.assertEquals(2099620376, model.checkpointFrequency()); - Assertions.assertEquals("g", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("mignohikkg", model.checkpointModel().uri()); - Assertions.assertEquals("pinde", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1931875786, model.earlyStoppingDelay()); - Assertions.assertEquals(1421822703, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(785027108, model.evaluationFrequency()); - Assertions.assertEquals(332997027, model.gradientAccumulationStep()); - Assertions.assertEquals(1895771662, model.layersToFreeze()); - Assertions.assertEquals(85.75601F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.learningRateScheduler()); - Assertions.assertEquals("zir", model.modelName()); - Assertions.assertEquals(31.809593F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(1519861948, model.numberOfEpochs()); - Assertions.assertEquals(833365863, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(688700290, model.randomSeed()); - Assertions.assertEquals(36.495888F, model.stepLRGamma()); - Assertions.assertEquals(829672692, model.stepLRStepSize()); - Assertions.assertEquals(1420035701, model.trainingBatchSize()); - Assertions.assertEquals(450644888, model.validationBatchSize()); - Assertions.assertEquals(51.71764F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1150687421, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.28705F, model.weightDecay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettings model = - new ImageModelSettings() - .withAdvancedSettings("va") - .withAmsGradient(false) - .withAugmentations("zknxkv") - .withBeta1(37.521465F) - .withBeta2(75.73106F) - .withCheckpointFrequency(2099620376) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("g") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("mignohikkg")) - .withCheckpointRunId("pinde") - .withDistributed(true) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1931875786) - .withEarlyStoppingPatience(1421822703) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(785027108) - .withGradientAccumulationStep(332997027) - .withLayersToFreeze(1895771662) - .withLearningRate(85.75601F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("zir") - .withMomentum(31.809593F) - .withNesterov(true) - .withNumberOfEpochs(1519861948) - .withNumberOfWorkers(833365863) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(688700290) - .withStepLRGamma(36.495888F) - .withStepLRStepSize(829672692) - .withTrainingBatchSize(1420035701) - .withValidationBatchSize(450644888) - .withWarmupCosineLRCycles(51.71764F) - .withWarmupCosineLRWarmupEpochs(1150687421) - .withWeightDecay(80.28705F); - model = BinaryData.fromObject(model).toObject(ImageModelSettings.class); - Assertions.assertEquals("va", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("zknxkv", model.augmentations()); - Assertions.assertEquals(37.521465F, model.beta1()); - Assertions.assertEquals(75.73106F, model.beta2()); - Assertions.assertEquals(2099620376, model.checkpointFrequency()); - Assertions.assertEquals("g", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("mignohikkg", model.checkpointModel().uri()); - Assertions.assertEquals("pinde", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1931875786, model.earlyStoppingDelay()); - Assertions.assertEquals(1421822703, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(785027108, model.evaluationFrequency()); - Assertions.assertEquals(332997027, model.gradientAccumulationStep()); - Assertions.assertEquals(1895771662, model.layersToFreeze()); - Assertions.assertEquals(85.75601F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.learningRateScheduler()); - Assertions.assertEquals("zir", model.modelName()); - Assertions.assertEquals(31.809593F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(1519861948, model.numberOfEpochs()); - Assertions.assertEquals(833365863, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(688700290, model.randomSeed()); - Assertions.assertEquals(36.495888F, model.stepLRGamma()); - Assertions.assertEquals(829672692, model.stepLRStepSize()); - Assertions.assertEquals(1420035701, model.trainingBatchSize()); - Assertions.assertEquals(450644888, model.validationBatchSize()); - Assertions.assertEquals(51.71764F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1150687421, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.28705F, model.weightDecay()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java deleted file mode 100644 index 563ad809fa991..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageObjectDetectionBase; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageObjectDetectionBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageObjectDetectionBase model = - BinaryData - .fromString( - "{\"modelSettings\":{\"boxDetectionsPerImage\":220622186,\"boxScoreThreshold\":34.980453,\"imageSize\":1257411321,\"maxSize\":921466837,\"minSize\":2015686275,\"modelSize\":\"None\",\"multiScale\":false,\"nmsIouThreshold\":0.77554584,\"tileGridSize\":\"aohoqkpjtnq\",\"tileOverlapRatio\":5.6527376,\"tilePredictionsNmsThreshold\":62.38328,\"validationIouThreshold\":84.67642,\"validationMetricType\":\"None\",\"advancedSettings\":\"m\",\"amsGradient\":true,\"augmentations\":\"ilm\",\"beta1\":66.63753,\"beta2\":77.31098,\"checkpointFrequency\":1645404857,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"nkkbjpjvlywltmfw\",\"description\":\"bjwhlwyjfnqzocr\"},\"checkpointRunId\":\"gczeuntgx\",\"distributed\":false,\"earlyStopping\":false,\"earlyStoppingDelay\":1555790042,\"earlyStoppingPatience\":1557956860,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1852855933,\"gradientAccumulationStep\":1891446844,\"layersToFreeze\":888077010,\"learningRate\":91.16553,\"learningRateScheduler\":\"None\",\"modelName\":\"xgyrihlgmgbehlqt\",\"momentum\":35.669476,\"nesterov\":true,\"numberOfEpochs\":2104814940,\"numberOfWorkers\":2146718478,\"optimizer\":\"None\",\"randomSeed\":961397870,\"stepLRGamma\":84.43488,\"stepLRStepSize\":1159798592,\"trainingBatchSize\":1968957759,\"validationBatchSize\":1595039473,\"warmupCosineLRCycles\":26.42473,\"warmupCosineLRWarmupEpochs\":1300894444,\"weightDecay\":80.86428},\"searchSpace\":[{\"boxDetectionsPerImage\":\"gsabvcipowzafc\",\"boxScoreThreshold\":\"umljcirvpef\",\"imageSize\":\"dvei\",\"maxSize\":\"tjnsx\",\"minSize\":\"jlnsj\",\"modelSize\":\"ju\",\"multiScale\":\"xbxq\",\"nmsIouThreshold\":\"vuaytuad\",\"tileGridSize\":\"xeqbwp\",\"tileOverlapRatio\":\"ghyksarcdrnxs\",\"tilePredictionsNmsThreshold\":\"vlzladl\",\"validationIouThreshold\":\"kpbqhvfdqqjw\",\"validationMetricType\":\"hwzdanojisgglmv\",\"amsGradient\":\"atuztjct\",\"augmentations\":\"pvbkaehxsmzyg\",\"beta1\":\"wakwseivmakxhys\",\"beta2\":\"ljuxl\",\"distributed\":\"ect\",\"earlyStopping\":\"fjmskdchmaiu\",\"earlyStoppingDelay\":\"vlzw\",\"earlyStoppingPatience\":\"gmfalkzazmgoked\",\"enableOnnxNormalization\":\"qafkmkrokzrth\",\"evaluationFrequency\":\"twpqrtva\",\"gradientAccumulationStep\":\"nqnixiezeagmce\",\"layersToFreeze\":\"uugedhfp\",\"learningRate\":\"tlzm\",\"learningRateScheduler\":\"syjdeolctae\",\"modelName\":\"syrled\",\"momentum\":\"ustbvtqigdx\",\"nesterov\":\"sgeafgfosehx\",\"numberOfEpochs\":\"sxezppkkwaa\",\"numberOfWorkers\":\"k\",\"optimizer\":\"jlpzeqtoyrp\",\"randomSeed\":\"xlaj\",\"stepLRGamma\":\"lpquevhamfow\",\"stepLRStepSize\":\"btmkekxpkzwaq\",\"trainingBatchSize\":\"fqovc\",\"validationBatchSize\":\"qbplvfiduszte\",\"warmupCosineLRCycles\":\"byjgmsfepx\",\"warmupCosineLRWarmupEpochs\":\"hpqadagrhrdicxdw\",\"weightDecay\":\"fowxwyovcxjsgbi\"},{\"boxDetectionsPerImage\":\"ukdveksbuhoduc\",\"boxScoreThreshold\":\"lscrdpibfdyjduss\",\"imageSize\":\"szekbh\",\"maxSize\":\"kaaggkreh\",\"minSize\":\"rnuybffljfii\",\"modelSize\":\"eoagsqta\",\"multiScale\":\"usrexxf\",\"nmsIouThreshold\":\"sqwudohzilfmnli\",\"tileGridSize\":\"simsfeypofqpmb\",\"tileOverlapRatio\":\"qgsdr\",\"tilePredictionsNmsThreshold\":\"ttjxophgerhsmvgo\",\"validationIouThreshold\":\"wzm\",\"validationMetricType\":\"lrixysfnimsq\",\"amsGradient\":\"wwmhkruwae\",\"augmentations\":\"ympmlqoin\",\"beta1\":\"duewihapfj\",\"beta2\":\"knjdiqfliejhp\",\"distributed\":\"bi\",\"earlyStopping\":\"fsbw\",\"earlyStoppingDelay\":\"ivbvzi\",\"earlyStoppingPatience\":\"wxgoooxzpra\",\"enableOnnxNormalization\":\"s\",\"evaluationFrequency\":\"knpdgzigjsu\",\"gradientAccumulationStep\":\"whgsaodkww\",\"layersToFreeze\":\"afoctohz\",\"learningRate\":\"quvwsxbgn\",\"learningRateScheduler\":\"ervqchoadhrsxqvz\",\"modelName\":\"pabdsrg\",\"momentum\":\"jglzrsubklrxhjnl\",\"nesterov\":\"etjdvqydieqqkwa\",\"numberOfEpochs\":\"wdxvqzxoebwg\",\"numberOfWorkers\":\"bibanbau\",\"optimizer\":\"tzvp\",\"randomSeed\":\"lozkxbzrp\",\"stepLRGamma\":\"plssanbtttk\",\"stepLRStepSize\":\"uxunrswg\",\"trainingBatchSize\":\"jhboyikebhuhks\",\"validationBatchSize\":\"wlokhueoijyzcq\",\"warmupCosineLRCycles\":\"zqzu\",\"warmupCosineLRWarmupEpochs\":\"s\",\"weightDecay\":\"ej\"}],\"limitSettings\":{\"maxConcurrentTrials\":1158343098,\"maxTrials\":2133185621,\"timeout\":\"PT173H26M33S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1464302974,\"evaluationInterval\":539908072},\"samplingAlgorithm\":\"Grid\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"cf\",\"description\":\"bmxsnxoc\"},\"validationDataSize\":82.41225782753845}") - .toObject(ImageObjectDetectionBase.class); - Assertions.assertEquals(1158343098, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(2133185621, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT173H26M33S"), model.limitSettings().timeout()); - Assertions.assertEquals(1464302974, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(539908072, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("bmxsnxoc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("cf", model.validationData().uri()); - Assertions.assertEquals(82.41225782753845D, model.validationDataSize()); - Assertions.assertEquals("m", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("ilm", model.modelSettings().augmentations()); - Assertions.assertEquals(66.63753F, model.modelSettings().beta1()); - Assertions.assertEquals(77.31098F, model.modelSettings().beta2()); - Assertions.assertEquals(1645404857, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("bjwhlwyjfnqzocr", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("nkkbjpjvlywltmfw", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("gczeuntgx", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1555790042, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1557956860, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1852855933, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1891446844, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(888077010, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(91.16553F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("xgyrihlgmgbehlqt", model.modelSettings().modelName()); - Assertions.assertEquals(35.669476F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(2104814940, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(2146718478, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.modelSettings().optimizer()); - Assertions.assertEquals(961397870, model.modelSettings().randomSeed()); - Assertions.assertEquals(84.43488F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1159798592, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1968957759, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1595039473, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(26.42473F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1300894444, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.86428F, model.modelSettings().weightDecay()); - Assertions.assertEquals(220622186, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(34.980453F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(1257411321, model.modelSettings().imageSize()); - Assertions.assertEquals(921466837, model.modelSettings().maxSize()); - Assertions.assertEquals(2015686275, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.NONE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(0.77554584F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("aohoqkpjtnq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(5.6527376F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(62.38328F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(84.67642F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.NONE, model.modelSettings().validationMetricType()); - Assertions.assertEquals("atuztjct", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("pvbkaehxsmzyg", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("wakwseivmakxhys", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("ljuxl", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("ect", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("fjmskdchmaiu", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vlzw", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("gmfalkzazmgoked", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("qafkmkrokzrth", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("twpqrtva", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("nqnixiezeagmce", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("uugedhfp", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("tlzm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("syjdeolctae", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("syrled", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("ustbvtqigdx", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("sgeafgfosehx", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("sxezppkkwaa", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("k", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("jlpzeqtoyrp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlaj", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("lpquevhamfow", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("btmkekxpkzwaq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("fqovc", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("qbplvfiduszte", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("byjgmsfepx", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("hpqadagrhrdicxdw", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("fowxwyovcxjsgbi", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("gsabvcipowzafc", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("umljcirvpef", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("dvei", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("tjnsx", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("jlnsj", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("ju", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("xbxq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("vuaytuad", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("xeqbwp", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("ghyksarcdrnxs", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("vlzladl", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("kpbqhvfdqqjw", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("hwzdanojisgglmv", model.searchSpace().get(0).validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageObjectDetectionBase model = - new ImageObjectDetectionBase() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1158343098) - .withMaxTrials(2133185621) - .withTimeout(Duration.parse("PT173H26M33S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1464302974) - .withEvaluationInterval(539908072)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID)) - .withValidationData( - new MLTableJobInput() - .withDescription("bmxsnxoc") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("cf")) - .withValidationDataSize(82.41225782753845D) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("m") - .withAmsGradient(true) - .withAugmentations("ilm") - .withBeta1(66.63753F) - .withBeta2(77.31098F) - .withCheckpointFrequency(1645404857) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("bjwhlwyjfnqzocr") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("nkkbjpjvlywltmfw")) - .withCheckpointRunId("gczeuntgx") - .withDistributed(false) - .withEarlyStopping(false) - .withEarlyStoppingDelay(1555790042) - .withEarlyStoppingPatience(1557956860) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1852855933) - .withGradientAccumulationStep(1891446844) - .withLayersToFreeze(888077010) - .withLearningRate(91.16553F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("xgyrihlgmgbehlqt") - .withMomentum(35.669476F) - .withNesterov(true) - .withNumberOfEpochs(2104814940) - .withNumberOfWorkers(2146718478) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(961397870) - .withStepLRGamma(84.43488F) - .withStepLRStepSize(1159798592) - .withTrainingBatchSize(1968957759) - .withValidationBatchSize(1595039473) - .withWarmupCosineLRCycles(26.42473F) - .withWarmupCosineLRWarmupEpochs(1300894444) - .withWeightDecay(80.86428F) - .withBoxDetectionsPerImage(220622186) - .withBoxScoreThreshold(34.980453F) - .withImageSize(1257411321) - .withMaxSize(921466837) - .withMinSize(2015686275) - .withModelSize(ModelSize.NONE) - .withMultiScale(false) - .withNmsIouThreshold(0.77554584F) - .withTileGridSize("aohoqkpjtnq") - .withTileOverlapRatio(5.6527376F) - .withTilePredictionsNmsThreshold(62.38328F) - .withValidationIouThreshold(84.67642F) - .withValidationMetricType(ValidationMetricType.NONE)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("atuztjct") - .withAugmentations("pvbkaehxsmzyg") - .withBeta1("wakwseivmakxhys") - .withBeta2("ljuxl") - .withDistributed("ect") - .withEarlyStopping("fjmskdchmaiu") - .withEarlyStoppingDelay("vlzw") - .withEarlyStoppingPatience("gmfalkzazmgoked") - .withEnableOnnxNormalization("qafkmkrokzrth") - .withEvaluationFrequency("twpqrtva") - .withGradientAccumulationStep("nqnixiezeagmce") - .withLayersToFreeze("uugedhfp") - .withLearningRate("tlzm") - .withLearningRateScheduler("syjdeolctae") - .withModelName("syrled") - .withMomentum("ustbvtqigdx") - .withNesterov("sgeafgfosehx") - .withNumberOfEpochs("sxezppkkwaa") - .withNumberOfWorkers("k") - .withOptimizer("jlpzeqtoyrp") - .withRandomSeed("xlaj") - .withStepLRGamma("lpquevhamfow") - .withStepLRStepSize("btmkekxpkzwaq") - .withTrainingBatchSize("fqovc") - .withValidationBatchSize("qbplvfiduszte") - .withWarmupCosineLRCycles("byjgmsfepx") - .withWarmupCosineLRWarmupEpochs("hpqadagrhrdicxdw") - .withWeightDecay("fowxwyovcxjsgbi") - .withBoxDetectionsPerImage("gsabvcipowzafc") - .withBoxScoreThreshold("umljcirvpef") - .withImageSize("dvei") - .withMaxSize("tjnsx") - .withMinSize("jlnsj") - .withModelSize("ju") - .withMultiScale("xbxq") - .withNmsIouThreshold("vuaytuad") - .withTileGridSize("xeqbwp") - .withTileOverlapRatio("ghyksarcdrnxs") - .withTilePredictionsNmsThreshold("vlzladl") - .withValidationIouThreshold("kpbqhvfdqqjw") - .withValidationMetricType("hwzdanojisgglmv"), - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("wwmhkruwae") - .withAugmentations("ympmlqoin") - .withBeta1("duewihapfj") - .withBeta2("knjdiqfliejhp") - .withDistributed("bi") - .withEarlyStopping("fsbw") - .withEarlyStoppingDelay("ivbvzi") - .withEarlyStoppingPatience("wxgoooxzpra") - .withEnableOnnxNormalization("s") - .withEvaluationFrequency("knpdgzigjsu") - .withGradientAccumulationStep("whgsaodkww") - .withLayersToFreeze("afoctohz") - .withLearningRate("quvwsxbgn") - .withLearningRateScheduler("ervqchoadhrsxqvz") - .withModelName("pabdsrg") - .withMomentum("jglzrsubklrxhjnl") - .withNesterov("etjdvqydieqqkwa") - .withNumberOfEpochs("wdxvqzxoebwg") - .withNumberOfWorkers("bibanbau") - .withOptimizer("tzvp") - .withRandomSeed("lozkxbzrp") - .withStepLRGamma("plssanbtttk") - .withStepLRStepSize("uxunrswg") - .withTrainingBatchSize("jhboyikebhuhks") - .withValidationBatchSize("wlokhueoijyzcq") - .withWarmupCosineLRCycles("zqzu") - .withWarmupCosineLRWarmupEpochs("s") - .withWeightDecay("ej") - .withBoxDetectionsPerImage("ukdveksbuhoduc") - .withBoxScoreThreshold("lscrdpibfdyjduss") - .withImageSize("szekbh") - .withMaxSize("kaaggkreh") - .withMinSize("rnuybffljfii") - .withModelSize("eoagsqta") - .withMultiScale("usrexxf") - .withNmsIouThreshold("sqwudohzilfmnli") - .withTileGridSize("simsfeypofqpmb") - .withTileOverlapRatio("qgsdr") - .withTilePredictionsNmsThreshold("ttjxophgerhsmvgo") - .withValidationIouThreshold("wzm") - .withValidationMetricType("lrixysfnimsq"))); - model = BinaryData.fromObject(model).toObject(ImageObjectDetectionBase.class); - Assertions.assertEquals(1158343098, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(2133185621, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT173H26M33S"), model.limitSettings().timeout()); - Assertions.assertEquals(1464302974, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(539908072, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("bmxsnxoc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("cf", model.validationData().uri()); - Assertions.assertEquals(82.41225782753845D, model.validationDataSize()); - Assertions.assertEquals("m", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("ilm", model.modelSettings().augmentations()); - Assertions.assertEquals(66.63753F, model.modelSettings().beta1()); - Assertions.assertEquals(77.31098F, model.modelSettings().beta2()); - Assertions.assertEquals(1645404857, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("bjwhlwyjfnqzocr", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("nkkbjpjvlywltmfw", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("gczeuntgx", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1555790042, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1557956860, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1852855933, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1891446844, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(888077010, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(91.16553F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("xgyrihlgmgbehlqt", model.modelSettings().modelName()); - Assertions.assertEquals(35.669476F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(2104814940, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(2146718478, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.modelSettings().optimizer()); - Assertions.assertEquals(961397870, model.modelSettings().randomSeed()); - Assertions.assertEquals(84.43488F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1159798592, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1968957759, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1595039473, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(26.42473F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1300894444, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.86428F, model.modelSettings().weightDecay()); - Assertions.assertEquals(220622186, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(34.980453F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(1257411321, model.modelSettings().imageSize()); - Assertions.assertEquals(921466837, model.modelSettings().maxSize()); - Assertions.assertEquals(2015686275, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.NONE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(0.77554584F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("aohoqkpjtnq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(5.6527376F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(62.38328F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(84.67642F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.NONE, model.modelSettings().validationMetricType()); - Assertions.assertEquals("atuztjct", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("pvbkaehxsmzyg", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("wakwseivmakxhys", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("ljuxl", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("ect", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("fjmskdchmaiu", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vlzw", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("gmfalkzazmgoked", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("qafkmkrokzrth", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("twpqrtva", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("nqnixiezeagmce", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("uugedhfp", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("tlzm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("syjdeolctae", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("syrled", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("ustbvtqigdx", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("sgeafgfosehx", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("sxezppkkwaa", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("k", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("jlpzeqtoyrp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlaj", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("lpquevhamfow", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("btmkekxpkzwaq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("fqovc", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("qbplvfiduszte", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("byjgmsfepx", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("hpqadagrhrdicxdw", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("fowxwyovcxjsgbi", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("gsabvcipowzafc", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("umljcirvpef", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("dvei", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("tjnsx", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("jlnsj", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("ju", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("xbxq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("vuaytuad", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("xeqbwp", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("ghyksarcdrnxs", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("vlzladl", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("kpbqhvfdqqjw", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("hwzdanojisgglmv", model.searchSpace().get(0).validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java deleted file mode 100644 index 020c235748c2a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.ObjectDetectionPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageObjectDetection model = - BinaryData - .fromString( - "{\"taskType\":\"ImageObjectDetection\",\"primaryMetric\":\"MeanAveragePrecision\",\"modelSettings\":{\"boxDetectionsPerImage\":667354640,\"boxScoreThreshold\":57.01898,\"imageSize\":920278919,\"maxSize\":546709544,\"minSize\":1447146223,\"modelSize\":\"Large\",\"multiScale\":true,\"nmsIouThreshold\":58.316856,\"tileGridSize\":\"sovyxpavidnievw\",\"tileOverlapRatio\":21.210634,\"tilePredictionsNmsThreshold\":54.720806,\"validationIouThreshold\":27.970045,\"validationMetricType\":\"Voc\",\"advancedSettings\":\"puxgcbdsvalpnpt\",\"amsGradient\":true,\"augmentations\":\"xgpazwugxyqv\",\"beta1\":72.82474,\"beta2\":87.86046,\"checkpointFrequency\":953919104,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"iuhzzgqlmfa\",\"description\":\"z\"},\"checkpointRunId\":\"udjpxpqht\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":1217471622,\"earlyStoppingPatience\":342924982,\"enableOnnxNormalization\":false,\"evaluationFrequency\":419853623,\"gradientAccumulationStep\":1049447036,\"layersToFreeze\":336351434,\"learningRate\":79.0951,\"learningRateScheduler\":\"None\",\"modelName\":\"uxsp\",\"momentum\":71.59348,\"nesterov\":false,\"numberOfEpochs\":1973063413,\"numberOfWorkers\":1796310561,\"optimizer\":\"Adamw\",\"randomSeed\":1409212705,\"stepLRGamma\":8.159346,\"stepLRStepSize\":99529171,\"trainingBatchSize\":1768553154,\"validationBatchSize\":385248466,\"warmupCosineLRCycles\":70.731415,\"warmupCosineLRWarmupEpochs\":2134877467,\"weightDecay\":72.09128},\"searchSpace\":[{\"boxDetectionsPerImage\":\"axdvwzaehp\",\"boxScoreThreshold\":\"thd\",\"imageSize\":\"mvetatlakfq\",\"maxSize\":\"xwgiks\",\"minSize\":\"vtooxrpo\",\"modelSize\":\"phchgjtnhtukfaci\",\"multiScale\":\"bfntumeezbxvq\",\"nmsIouThreshold\":\"nuvwcgasgomtmjzw\",\"tileGridSize\":\"qgo\",\"tileOverlapRatio\":\"xpwwzt\",\"tilePredictionsNmsThreshold\":\"mkkhtgfredml\",\"validationIouThreshold\":\"grllcc\",\"validationMetricType\":\"ovjowazhpabacom\",\"amsGradient\":\"otgkwsxnsrqorcg\",\"augmentations\":\"mv\",\"beta1\":\"bxeetqujxcxxqn\",\"beta2\":\"qjkedwqurc\",\"distributed\":\"jmrvvxwjongz\",\"earlyStopping\":\"hqqrsilcch\",\"earlyStoppingDelay\":\"xxkan\",\"earlyStoppingPatience\":\"vri\",\"enableOnnxNormalization\":\"gv\",\"evaluationFrequency\":\"jrulfucte\",\"gradientAccumulationStep\":\"thcfj\",\"layersToFreeze\":\"xlyubqjrostv\",\"learningRate\":\"eqmtzzbeqrz\",\"learningRateScheduler\":\"x\",\"modelName\":\"xrd\",\"momentum\":\"bsrwrsnrhpqat\",\"nesterov\":\"kkvyanxk\",\"numberOfEpochs\":\"csemsvuvd\",\"numberOfWorkers\":\"qxetqmmlivrjjx\",\"optimizer\":\"xdchp\",\"randomSeed\":\"xlehzlxpgfquwzp\",\"stepLRGamma\":\"ibelwcerwkw\",\"stepLRStepSize\":\"jxljtxbusq\",\"trainingBatchSize\":\"xxniuisdzhgbd\",\"validationBatchSize\":\"pagsecnad\",\"warmupCosineLRCycles\":\"wqrgxfllmqi\",\"warmupCosineLRWarmupEpochs\":\"ezoell\",\"weightDecay\":\"kiiwvmtu\"}],\"limitSettings\":{\"maxConcurrentTrials\":259319343,\"maxTrials\":1465106108,\"timeout\":\"PT14H16M47S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1028451528,\"evaluationInterval\":1879980006},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"ilrgun\",\"description\":\"nlduwzorxsbm\"},\"validationDataSize\":10.09388413403216,\"logVerbosity\":\"Warning\",\"targetColumnName\":\"mxkqvf\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"dxcltuubwyvpj\",\"description\":\"wcpjqduqgi\"}}") - .toObject(ImageObjectDetection.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("mxkqvf", model.targetColumnName()); - Assertions.assertEquals("wcpjqduqgi", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("dxcltuubwyvpj", model.trainingData().uri()); - Assertions.assertEquals(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("puxgcbdsvalpnpt", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("xgpazwugxyqv", model.modelSettings().augmentations()); - Assertions.assertEquals(72.82474F, model.modelSettings().beta1()); - Assertions.assertEquals(87.86046F, model.modelSettings().beta2()); - Assertions.assertEquals(953919104, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("z", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("iuhzzgqlmfa", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("udjpxpqht", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1217471622, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(342924982, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(419853623, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1049447036, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(336351434, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(79.0951F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("uxsp", model.modelSettings().modelName()); - Assertions.assertEquals(71.59348F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1973063413, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1796310561, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(1409212705, model.modelSettings().randomSeed()); - Assertions.assertEquals(8.159346F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(99529171, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1768553154, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(385248466, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(70.731415F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2134877467, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(72.09128F, model.modelSettings().weightDecay()); - Assertions.assertEquals(667354640, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(57.01898F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(920278919, model.modelSettings().imageSize()); - Assertions.assertEquals(546709544, model.modelSettings().maxSize()); - Assertions.assertEquals(1447146223, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(true, model.modelSettings().multiScale()); - Assertions.assertEquals(58.316856F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("sovyxpavidnievw", model.modelSettings().tileGridSize()); - Assertions.assertEquals(21.210634F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(54.720806F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(27.970045F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("otgkwsxnsrqorcg", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("mv", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("bxeetqujxcxxqn", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("qjkedwqurc", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("jmrvvxwjongz", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("hqqrsilcch", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("xxkan", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("vri", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("gv", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("jrulfucte", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("thcfj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("xlyubqjrostv", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("eqmtzzbeqrz", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("x", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("xrd", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("bsrwrsnrhpqat", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("kkvyanxk", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("csemsvuvd", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("qxetqmmlivrjjx", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("xdchp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlehzlxpgfquwzp", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("ibelwcerwkw", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("jxljtxbusq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("xxniuisdzhgbd", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("pagsecnad", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("wqrgxfllmqi", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("ezoell", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("kiiwvmtu", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("axdvwzaehp", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("thd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("mvetatlakfq", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("xwgiks", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("vtooxrpo", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("phchgjtnhtukfaci", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("bfntumeezbxvq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("nuvwcgasgomtmjzw", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("qgo", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpwwzt", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("mkkhtgfredml", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("grllcc", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("ovjowazhpabacom", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(259319343, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1465106108, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT14H16M47S"), model.limitSettings().timeout()); - Assertions.assertEquals(1028451528, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1879980006, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nlduwzorxsbm", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("ilrgun", model.validationData().uri()); - Assertions.assertEquals(10.09388413403216D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageObjectDetection model = - new ImageObjectDetection() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("mxkqvf") - .withTrainingData( - new MLTableJobInput() - .withDescription("wcpjqduqgi") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("dxcltuubwyvpj")) - .withPrimaryMetric(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("puxgcbdsvalpnpt") - .withAmsGradient(true) - .withAugmentations("xgpazwugxyqv") - .withBeta1(72.82474F) - .withBeta2(87.86046F) - .withCheckpointFrequency(953919104) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("z") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("iuhzzgqlmfa")) - .withCheckpointRunId("udjpxpqht") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(1217471622) - .withEarlyStoppingPatience(342924982) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(419853623) - .withGradientAccumulationStep(1049447036) - .withLayersToFreeze(336351434) - .withLearningRate(79.0951F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("uxsp") - .withMomentum(71.59348F) - .withNesterov(false) - .withNumberOfEpochs(1973063413) - .withNumberOfWorkers(1796310561) - .withOptimizer(StochasticOptimizer.ADAMW) - .withRandomSeed(1409212705) - .withStepLRGamma(8.159346F) - .withStepLRStepSize(99529171) - .withTrainingBatchSize(1768553154) - .withValidationBatchSize(385248466) - .withWarmupCosineLRCycles(70.731415F) - .withWarmupCosineLRWarmupEpochs(2134877467) - .withWeightDecay(72.09128F) - .withBoxDetectionsPerImage(667354640) - .withBoxScoreThreshold(57.01898F) - .withImageSize(920278919) - .withMaxSize(546709544) - .withMinSize(1447146223) - .withModelSize(ModelSize.LARGE) - .withMultiScale(true) - .withNmsIouThreshold(58.316856F) - .withTileGridSize("sovyxpavidnievw") - .withTileOverlapRatio(21.210634F) - .withTilePredictionsNmsThreshold(54.720806F) - .withValidationIouThreshold(27.970045F) - .withValidationMetricType(ValidationMetricType.VOC)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("otgkwsxnsrqorcg") - .withAugmentations("mv") - .withBeta1("bxeetqujxcxxqn") - .withBeta2("qjkedwqurc") - .withDistributed("jmrvvxwjongz") - .withEarlyStopping("hqqrsilcch") - .withEarlyStoppingDelay("xxkan") - .withEarlyStoppingPatience("vri") - .withEnableOnnxNormalization("gv") - .withEvaluationFrequency("jrulfucte") - .withGradientAccumulationStep("thcfj") - .withLayersToFreeze("xlyubqjrostv") - .withLearningRate("eqmtzzbeqrz") - .withLearningRateScheduler("x") - .withModelName("xrd") - .withMomentum("bsrwrsnrhpqat") - .withNesterov("kkvyanxk") - .withNumberOfEpochs("csemsvuvd") - .withNumberOfWorkers("qxetqmmlivrjjx") - .withOptimizer("xdchp") - .withRandomSeed("xlehzlxpgfquwzp") - .withStepLRGamma("ibelwcerwkw") - .withStepLRStepSize("jxljtxbusq") - .withTrainingBatchSize("xxniuisdzhgbd") - .withValidationBatchSize("pagsecnad") - .withWarmupCosineLRCycles("wqrgxfllmqi") - .withWarmupCosineLRWarmupEpochs("ezoell") - .withWeightDecay("kiiwvmtu") - .withBoxDetectionsPerImage("axdvwzaehp") - .withBoxScoreThreshold("thd") - .withImageSize("mvetatlakfq") - .withMaxSize("xwgiks") - .withMinSize("vtooxrpo") - .withModelSize("phchgjtnhtukfaci") - .withMultiScale("bfntumeezbxvq") - .withNmsIouThreshold("nuvwcgasgomtmjzw") - .withTileGridSize("qgo") - .withTileOverlapRatio("xpwwzt") - .withTilePredictionsNmsThreshold("mkkhtgfredml") - .withValidationIouThreshold("grllcc") - .withValidationMetricType("ovjowazhpabacom"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(259319343) - .withMaxTrials(1465106108) - .withTimeout(Duration.parse("PT14H16M47S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1028451528) - .withEvaluationInterval(1879980006)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput() - .withDescription("nlduwzorxsbm") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("ilrgun")) - .withValidationDataSize(10.09388413403216D); - model = BinaryData.fromObject(model).toObject(ImageObjectDetection.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("mxkqvf", model.targetColumnName()); - Assertions.assertEquals("wcpjqduqgi", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("dxcltuubwyvpj", model.trainingData().uri()); - Assertions.assertEquals(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("puxgcbdsvalpnpt", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("xgpazwugxyqv", model.modelSettings().augmentations()); - Assertions.assertEquals(72.82474F, model.modelSettings().beta1()); - Assertions.assertEquals(87.86046F, model.modelSettings().beta2()); - Assertions.assertEquals(953919104, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("z", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("iuhzzgqlmfa", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("udjpxpqht", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1217471622, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(342924982, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(419853623, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1049447036, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(336351434, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(79.0951F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("uxsp", model.modelSettings().modelName()); - Assertions.assertEquals(71.59348F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1973063413, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1796310561, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(1409212705, model.modelSettings().randomSeed()); - Assertions.assertEquals(8.159346F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(99529171, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1768553154, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(385248466, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(70.731415F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2134877467, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(72.09128F, model.modelSettings().weightDecay()); - Assertions.assertEquals(667354640, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(57.01898F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(920278919, model.modelSettings().imageSize()); - Assertions.assertEquals(546709544, model.modelSettings().maxSize()); - Assertions.assertEquals(1447146223, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(true, model.modelSettings().multiScale()); - Assertions.assertEquals(58.316856F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("sovyxpavidnievw", model.modelSettings().tileGridSize()); - Assertions.assertEquals(21.210634F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(54.720806F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(27.970045F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("otgkwsxnsrqorcg", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("mv", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("bxeetqujxcxxqn", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("qjkedwqurc", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("jmrvvxwjongz", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("hqqrsilcch", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("xxkan", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("vri", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("gv", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("jrulfucte", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("thcfj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("xlyubqjrostv", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("eqmtzzbeqrz", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("x", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("xrd", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("bsrwrsnrhpqat", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("kkvyanxk", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("csemsvuvd", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("qxetqmmlivrjjx", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("xdchp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlehzlxpgfquwzp", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("ibelwcerwkw", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("jxljtxbusq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("xxniuisdzhgbd", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("pagsecnad", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("wqrgxfllmqi", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("ezoell", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("kiiwvmtu", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("axdvwzaehp", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("thd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("mvetatlakfq", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("xwgiks", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("vtooxrpo", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("phchgjtnhtukfaci", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("bfntumeezbxvq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("nuvwcgasgomtmjzw", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("qgo", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpwwzt", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("mkkhtgfredml", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("grllcc", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("ovjowazhpabacom", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(259319343, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1465106108, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT14H16M47S"), model.limitSettings().timeout()); - Assertions.assertEquals(1028451528, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1879980006, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nlduwzorxsbm", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("ilrgun", model.validationData().uri()); - Assertions.assertEquals(10.09388413403216D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java deleted file mode 100644 index 1fa3bcb215770..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import org.junit.jupiter.api.Assertions; - -public final class ImageSweepSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageSweepSettings model = - BinaryData - .fromString( - "{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":790899458,\"evaluationInterval\":2024803970},\"samplingAlgorithm\":\"Grid\"}") - .toObject(ImageSweepSettings.class); - Assertions.assertEquals(790899458, model.earlyTermination().delayEvaluation()); - Assertions.assertEquals(2024803970, model.earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.samplingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageSweepSettings model = - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy().withDelayEvaluation(790899458).withEvaluationInterval(2024803970)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID); - model = BinaryData.fromObject(model).toObject(ImageSweepSettings.class); - Assertions.assertEquals(790899458, model.earlyTermination().delayEvaluation()); - Assertions.assertEquals(2024803970, model.earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.samplingAlgorithm()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java deleted file mode 100644 index 1cfdd03fee4e0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.ImageVertical; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ImageVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageVertical model = - BinaryData - .fromString( - "{\"limitSettings\":{\"maxConcurrentTrials\":4557833,\"maxTrials\":267543853,\"timeout\":\"PT33H18M38S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1370366721,\"evaluationInterval\":1583622668},\"samplingAlgorithm\":\"Grid\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"lbcnndt\",\"description\":\"xawqy\"},\"validationDataSize\":69.16610610373561}") - .toObject(ImageVertical.class); - Assertions.assertEquals(4557833, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(267543853, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT33H18M38S"), model.limitSettings().timeout()); - Assertions.assertEquals(1370366721, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1583622668, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("xawqy", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lbcnndt", model.validationData().uri()); - Assertions.assertEquals(69.16610610373561D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageVertical model = - new ImageVertical() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(4557833) - .withMaxTrials(267543853) - .withTimeout(Duration.parse("PT33H18M38S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1370366721) - .withEvaluationInterval(1583622668)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID)) - .withValidationData( - new MLTableJobInput() - .withDescription("xawqy") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("lbcnndt")) - .withValidationDataSize(69.16610610373561D); - model = BinaryData.fromObject(model).toObject(ImageVertical.class); - Assertions.assertEquals(4557833, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(267543853, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT33H18M38S"), model.limitSettings().timeout()); - Assertions.assertEquals(1370366721, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1583622668, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("xawqy", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lbcnndt", model.validationData().uri()); - Assertions.assertEquals(69.16610610373561D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java deleted file mode 100644 index bab5e5cf902d5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.Route; -import org.junit.jupiter.api.Assertions; - -public final class InferenceContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InferenceContainerProperties model = - BinaryData - .fromString( - "{\"livenessRoute\":{\"path\":\"xgqddrih\",\"port\":1351999302},\"readinessRoute\":{\"path\":\"oqcaaewdaomdj\",\"port\":68062218},\"scoringRoute\":{\"path\":\"jxxkzbrmsgei\",\"port\":1985792970}}") - .toObject(InferenceContainerProperties.class); - Assertions.assertEquals("xgqddrih", model.livenessRoute().path()); - Assertions.assertEquals(1351999302, model.livenessRoute().port()); - Assertions.assertEquals("oqcaaewdaomdj", model.readinessRoute().path()); - Assertions.assertEquals(68062218, model.readinessRoute().port()); - Assertions.assertEquals("jxxkzbrmsgei", model.scoringRoute().path()); - Assertions.assertEquals(1985792970, model.scoringRoute().port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InferenceContainerProperties model = - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("xgqddrih").withPort(1351999302)) - .withReadinessRoute(new Route().withPath("oqcaaewdaomdj").withPort(68062218)) - .withScoringRoute(new Route().withPath("jxxkzbrmsgei").withPort(1985792970)); - model = BinaryData.fromObject(model).toObject(InferenceContainerProperties.class); - Assertions.assertEquals("xgqddrih", model.livenessRoute().path()); - Assertions.assertEquals(1351999302, model.livenessRoute().port()); - Assertions.assertEquals("oqcaaewdaomdj", model.readinessRoute().path()); - Assertions.assertEquals(68062218, model.readinessRoute().port()); - Assertions.assertEquals("jxxkzbrmsgei", model.scoringRoute().path()); - Assertions.assertEquals(1985792970, model.scoringRoute().port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java deleted file mode 100644 index c367b4075c1e8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InstanceTypeSchemaResourcesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstanceTypeSchemaResources model = - BinaryData - .fromString( - "{\"requests\":{\"wnwvroevytlyokr\":\"bannovvoxczytp\",\"o\":\"rouuxvnsasbcry\",\"xnazpmkml\":\"izrxklob\"},\"limits\":{\"zxlioh\":\"vfxzopjh\",\"dtfgxqbawpcbb\":\"d\",\"ofyuicd\":\"zqcyknap\",\"ybww\":\"zb\"}}") - .toObject(InstanceTypeSchemaResources.class); - Assertions.assertEquals("bannovvoxczytp", model.requests().get("wnwvroevytlyokr")); - Assertions.assertEquals("vfxzopjh", model.limits().get("zxlioh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstanceTypeSchemaResources model = - new InstanceTypeSchemaResources() - .withRequests( - mapOf("wnwvroevytlyokr", "bannovvoxczytp", "o", "rouuxvnsasbcry", "xnazpmkml", "izrxklob")) - .withLimits(mapOf("zxlioh", "vfxzopjh", "dtfgxqbawpcbb", "d", "ofyuicd", "zqcyknap", "ybww", "zb")); - model = BinaryData.fromObject(model).toObject(InstanceTypeSchemaResources.class); - Assertions.assertEquals("bannovvoxczytp", model.requests().get("wnwvroevytlyokr")); - Assertions.assertEquals("vfxzopjh", model.limits().get("zxlioh")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java deleted file mode 100644 index efe4a50a76957..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InstanceTypeSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstanceTypeSchema model = - BinaryData - .fromString( - "{\"nodeSelector\":{\"bo\":\"v\"},\"resources\":{\"requests\":{\"q\":\"xypokkhmi\",\"ngnbdxxew\":\"ymc\",\"qecrqctmxx\":\"ninvudbchaqdt\"},\"limits\":{\"vtzn\":\"dmflhuytx\"}}}") - .toObject(InstanceTypeSchema.class); - Assertions.assertEquals("v", model.nodeSelector().get("bo")); - Assertions.assertEquals("xypokkhmi", model.resources().requests().get("q")); - Assertions.assertEquals("dmflhuytx", model.resources().limits().get("vtzn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstanceTypeSchema model = - new InstanceTypeSchema() - .withNodeSelector(mapOf("bo", "v")) - .withResources( - new InstanceTypeSchemaResources() - .withRequests(mapOf("q", "xypokkhmi", "ngnbdxxew", "ymc", "qecrqctmxx", "ninvudbchaqdt")) - .withLimits(mapOf("vtzn", "dmflhuytx"))); - model = BinaryData.fromObject(model).toObject(InstanceTypeSchema.class); - Assertions.assertEquals("v", model.nodeSelector().get("bo")); - Assertions.assertEquals("xypokkhmi", model.resources().requests().get("q")); - Assertions.assertEquals("dmflhuytx", model.resources().limits().get("vtzn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java deleted file mode 100644 index 868c0bd7be76c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"fvjlboxqvkjlmx\",\"computeId\":\"mdy\",\"displayName\":\"dwdigumb\",\"experimentName\":\"aauzzptjazysd\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":false,\"services\":{\"y\":{\"endpoint\":\"aiqyuvvfo\",\"errorMessage\":\"p\",\"jobServiceType\":\"qyikvy\",\"port\":1053518025,\"properties\":{},\"status\":\"vluwmncsttij\"}},\"status\":\"NotResponding\",\"description\":\"ekrsgs\",\"properties\":{\"dgkynscliqhzvhxn\":\"huzqgn\",\"tppn\":\"omtkub\",\"frbbc\":\"dxzxhi\"},\"tags\":{\"ykvgtrdcnifmz\":\"agtltdhlfkqoj\"}},\"id\":\"dymbrny\",\"name\":\"u\",\"type\":\"m\"}") - .toObject(JobBaseInner.class); - Assertions.assertEquals("ekrsgs", model.properties().description()); - Assertions.assertEquals("huzqgn", model.properties().properties().get("dgkynscliqhzvhxn")); - Assertions.assertEquals("agtltdhlfkqoj", model.properties().tags().get("ykvgtrdcnifmz")); - Assertions.assertEquals("fvjlboxqvkjlmx", model.properties().componentId()); - Assertions.assertEquals("mdy", model.properties().computeId()); - Assertions.assertEquals("dwdigumb", model.properties().displayName()); - Assertions.assertEquals("aauzzptjazysd", model.properties().experimentName()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("aiqyuvvfo", model.properties().services().get("y").endpoint()); - Assertions.assertEquals("qyikvy", model.properties().services().get("y").jobServiceType()); - Assertions.assertEquals(1053518025, model.properties().services().get("y").port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseInner model = - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("ekrsgs") - .withProperties(mapOf("dgkynscliqhzvhxn", "huzqgn", "tppn", "omtkub", "frbbc", "dxzxhi")) - .withTags(mapOf("ykvgtrdcnifmz", "agtltdhlfkqoj")) - .withComponentId("fvjlboxqvkjlmx") - .withComputeId("mdy") - .withDisplayName("dwdigumb") - .withExperimentName("aauzzptjazysd") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(false) - .withServices( - mapOf( - "y", - new JobService() - .withEndpoint("aiqyuvvfo") - .withJobServiceType("qyikvy") - .withPort(1053518025) - .withProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobBaseInner.class); - Assertions.assertEquals("ekrsgs", model.properties().description()); - Assertions.assertEquals("huzqgn", model.properties().properties().get("dgkynscliqhzvhxn")); - Assertions.assertEquals("agtltdhlfkqoj", model.properties().tags().get("ykvgtrdcnifmz")); - Assertions.assertEquals("fvjlboxqvkjlmx", model.properties().componentId()); - Assertions.assertEquals("mdy", model.properties().computeId()); - Assertions.assertEquals("dwdigumb", model.properties().displayName()); - Assertions.assertEquals("aauzzptjazysd", model.properties().experimentName()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("aiqyuvvfo", model.properties().services().get("y").endpoint()); - Assertions.assertEquals("qyikvy", model.properties().services().get("y").jobServiceType()); - Assertions.assertEquals(1053518025, model.properties().services().get("y").port()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java deleted file mode 100644 index 44ccda7459915..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseProperties model = - BinaryData - .fromString( - "{\"jobType\":\"JobBaseProperties\",\"componentId\":\"a\",\"computeId\":\"g\",\"displayName\":\"hocxvdfffwafqrou\",\"experimentName\":\"spave\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"xdbeesmieknl\":{\"endpoint\":\"n\",\"errorMessage\":\"zudhcxg\",\"jobServiceType\":\"oyxcdyuib\",\"port\":595382657,\"properties\":{\"aeoisrvh\":\"bzydvfvfcj\",\"ukiscvwmzhw\":\"gorf\",\"nzeyqxtjj\":\"lefaxvxilcbtgn\"},\"status\":\"qlqhycavodg\"},\"cjhfgmvecactxmw\":{\"endpoint\":\"riaa\",\"errorMessage\":\"uagydwqfbylyrf\",\"jobServiceType\":\"agt\",\"port\":1621141865,\"properties\":{\"zldmozuxy\":\"qwogfnzjvus\",\"ysownbtgkbug\":\"fsbtkad\",\"pe\":\"jqctojcmisofie\",\"hihihlhzdsqtzbsr\":\"ojyqdhcuplcplcw\"},\"status\":\"o\"},\"etoge\":{\"endpoint\":\"e\",\"errorMessage\":\"wcluqovekqvgq\",\"jobServiceType\":\"wifzmp\",\"port\":1626415565,\"properties\":{\"rfsphuagrt\":\"qikfxcv\",\"xubyjaffmmfblcqc\":\"ikteusqczkvyk\",\"brta\":\"ubgq\",\"lqxihhrmooiz\":\"metttwgd\"},\"status\":\"eypxiutcxapzhyr\"}},\"status\":\"Preparing\",\"description\":\"slhvnhlab\",\"properties\":{\"hvv\":\"kkzjcjbtrga\"},\"tags\":{\"oqbeitpkxzt\":\"xjjs\",\"pimaqxzhemjyh\":\"oobklftidgfcwq\",\"bawpfajnjwltlwt\":\"hujswtwkozzwcul\",\"uktalhsnvkcdmxz\":\"j\"}}") - .toObject(JobBaseProperties.class); - Assertions.assertEquals("slhvnhlab", model.description()); - Assertions.assertEquals("kkzjcjbtrga", model.properties().get("hvv")); - Assertions.assertEquals("xjjs", model.tags().get("oqbeitpkxzt")); - Assertions.assertEquals("a", model.componentId()); - Assertions.assertEquals("g", model.computeId()); - Assertions.assertEquals("hocxvdfffwafqrou", model.displayName()); - Assertions.assertEquals("spave", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("n", model.services().get("xdbeesmieknl").endpoint()); - Assertions.assertEquals("oyxcdyuib", model.services().get("xdbeesmieknl").jobServiceType()); - Assertions.assertEquals(595382657, model.services().get("xdbeesmieknl").port()); - Assertions.assertEquals("bzydvfvfcj", model.services().get("xdbeesmieknl").properties().get("aeoisrvh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseProperties model = - new JobBaseProperties() - .withDescription("slhvnhlab") - .withProperties(mapOf("hvv", "kkzjcjbtrga")) - .withTags( - mapOf( - "oqbeitpkxzt", - "xjjs", - "pimaqxzhemjyh", - "oobklftidgfcwq", - "bawpfajnjwltlwt", - "hujswtwkozzwcul", - "uktalhsnvkcdmxz", - "j")) - .withComponentId("a") - .withComputeId("g") - .withDisplayName("hocxvdfffwafqrou") - .withExperimentName("spave") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "xdbeesmieknl", - new JobService() - .withEndpoint("n") - .withJobServiceType("oyxcdyuib") - .withPort(595382657) - .withProperties( - mapOf("aeoisrvh", "bzydvfvfcj", "ukiscvwmzhw", "gorf", "nzeyqxtjj", "lefaxvxilcbtgn")), - "cjhfgmvecactxmw", - new JobService() - .withEndpoint("riaa") - .withJobServiceType("agt") - .withPort(1621141865) - .withProperties( - mapOf( - "zldmozuxy", - "qwogfnzjvus", - "ysownbtgkbug", - "fsbtkad", - "pe", - "jqctojcmisofie", - "hihihlhzdsqtzbsr", - "ojyqdhcuplcplcw")), - "etoge", - new JobService() - .withEndpoint("e") - .withJobServiceType("wifzmp") - .withPort(1626415565) - .withProperties( - mapOf( - "rfsphuagrt", - "qikfxcv", - "xubyjaffmmfblcqc", - "ikteusqczkvyk", - "brta", - "ubgq", - "lqxihhrmooiz", - "metttwgd")))); - model = BinaryData.fromObject(model).toObject(JobBaseProperties.class); - Assertions.assertEquals("slhvnhlab", model.description()); - Assertions.assertEquals("kkzjcjbtrga", model.properties().get("hvv")); - Assertions.assertEquals("xjjs", model.tags().get("oqbeitpkxzt")); - Assertions.assertEquals("a", model.componentId()); - Assertions.assertEquals("g", model.computeId()); - Assertions.assertEquals("hocxvdfffwafqrou", model.displayName()); - Assertions.assertEquals("spave", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("n", model.services().get("xdbeesmieknl").endpoint()); - Assertions.assertEquals("oyxcdyuib", model.services().get("xdbeesmieknl").jobServiceType()); - Assertions.assertEquals(595382657, model.services().get("xdbeesmieknl").port()); - Assertions.assertEquals("bzydvfvfcj", model.services().get("xdbeesmieknl").properties().get("aeoisrvh")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java deleted file mode 100644 index dfdc7ec3e5e6c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobBaseResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBaseResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"zoggculapz\",\"value\":[{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"gogtqxepnylbf\",\"computeId\":\"jlyjtlvofq\",\"displayName\":\"vfcibyfmowux\",\"experimentName\":\"jpvd\",\"isArchived\":true,\"services\":{},\"status\":\"Queued\",\"description\":\"wzjbh\",\"properties\":{},\"tags\":{}},\"id\":\"jrkambtrnegvmnv\",\"name\":\"q\",\"type\":\"qvldspastjbkkd\"},{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"lves\",\"computeId\":\"jlxr\",\"displayName\":\"lozapeewchpxlk\",\"experimentName\":\"kuziycsle\",\"isArchived\":true,\"services\":{},\"status\":\"Preparing\",\"description\":\"tyh\",\"properties\":{},\"tags\":{}},\"id\":\"dcgzul\",\"name\":\"mmrqz\",\"type\":\"rr\"},{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"pglydz\",\"computeId\":\"rvqeevtoepryutn\",\"displayName\":\"tpzdmovzvfvaawzq\",\"experimentName\":\"f\",\"isArchived\":false,\"services\":{},\"status\":\"Provisioning\",\"description\":\"aecxndtic\",\"properties\":{},\"tags\":{}},\"id\":\"zmlqtmldgxo\",\"name\":\"firclnpkciayz\",\"type\":\"iykhy\"}]}") - .toObject(JobBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("zoggculapz", model.nextLink()); - Assertions.assertEquals("wzjbh", model.value().get(0).properties().description()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).properties().componentId()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).properties().computeId()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).properties().displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).properties().experimentName()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseResourceArmPaginatedResult model = - new JobBaseResourceArmPaginatedResult() - .withNextLink("zoggculapz") - .withValue( - Arrays - .asList( - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("wzjbh") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("gogtqxepnylbf") - .withComputeId("jlyjtlvofq") - .withDisplayName("vfcibyfmowux") - .withExperimentName("jpvd") - .withIsArchived(true) - .withServices(mapOf())), - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("tyh") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("lves") - .withComputeId("jlxr") - .withDisplayName("lozapeewchpxlk") - .withExperimentName("kuziycsle") - .withIsArchived(true) - .withServices(mapOf())), - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("aecxndtic") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("pglydz") - .withComputeId("rvqeevtoepryutn") - .withDisplayName("tpzdmovzvfvaawzq") - .withExperimentName("f") - .withIsArchived(false) - .withServices(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("zoggculapz", model.nextLink()); - Assertions.assertEquals("wzjbh", model.value().get(0).properties().description()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).properties().componentId()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).properties().computeId()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).properties().displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).properties().experimentName()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java deleted file mode 100644 index c2332d6a9fe18..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobInput; -import org.junit.jupiter.api.Assertions; - -public final class JobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobInput model = - BinaryData.fromString("{\"jobInputType\":\"JobInput\",\"description\":\"pjby\"}").toObject(JobInput.class); - Assertions.assertEquals("pjby", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobInput model = new JobInput().withDescription("pjby"); - model = BinaryData.fromObject(model).toObject(JobInput.class); - Assertions.assertEquals("pjby", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java deleted file mode 100644 index b656997bc9fa2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class JobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"JobLimits\",\"timeout\":\"PT90H18M40S\"}") - .toObject(JobLimits.class); - Assertions.assertEquals(Duration.parse("PT90H18M40S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobLimits model = new JobLimits().withTimeout(Duration.parse("PT90H18M40S")); - model = BinaryData.fromObject(model).toObject(JobLimits.class); - Assertions.assertEquals(Duration.parse("PT90H18M40S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java deleted file mode 100644 index 26db9eb1fe842..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import org.junit.jupiter.api.Assertions; - -public final class JobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobOutput model = - BinaryData - .fromString("{\"jobOutputType\":\"JobOutput\",\"description\":\"qmbzmq\"}") - .toObject(JobOutput.class); - Assertions.assertEquals("qmbzmq", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobOutput model = new JobOutput().withDescription("qmbzmq"); - model = BinaryData.fromObject(model).toObject(JobOutput.class); - Assertions.assertEquals("qmbzmq", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java deleted file mode 100644 index 016031d683192..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobResourceConfiguration model = - BinaryData - .fromString( - "{\"dockerArgs\":\"atbnxwbj\",\"shmSize\":\"dbirkfpksokdgo\",\"instanceCount\":1548314621,\"instanceType\":\"jymrhbg\",\"properties\":{\"nfnzhhh\":\"datazkye\",\"mffjkutycyarn\":\"datao\",\"pyc\":\"dataoohguabzoghkt\"}}") - .toObject(JobResourceConfiguration.class); - Assertions.assertEquals(1548314621, model.instanceCount()); - Assertions.assertEquals("jymrhbg", model.instanceType()); - Assertions.assertEquals("atbnxwbj", model.dockerArgs()); - Assertions.assertEquals("dbirkfpksokdgo", model.shmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobResourceConfiguration model = - new JobResourceConfiguration() - .withInstanceCount(1548314621) - .withInstanceType("jymrhbg") - .withProperties(mapOf("nfnzhhh", "datazkye", "mffjkutycyarn", "datao", "pyc", "dataoohguabzoghkt")) - .withDockerArgs("atbnxwbj") - .withShmSize("dbirkfpksokdgo"); - model = BinaryData.fromObject(model).toObject(JobResourceConfiguration.class); - Assertions.assertEquals(1548314621, model.instanceCount()); - Assertions.assertEquals("jymrhbg", model.instanceType()); - Assertions.assertEquals("atbnxwbj", model.dockerArgs()); - Assertions.assertEquals("dbirkfpksokdgo", model.shmSize()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java deleted file mode 100644 index 169695892b2ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobScheduleAction; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobScheduleActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobScheduleAction model = - BinaryData - .fromString( - "{\"actionType\":\"CreateJob\",\"jobDefinition\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"xkydfbwlja\",\"computeId\":\"uerkjddvrg\",\"displayName\":\"egftcvb\",\"experimentName\":\"ftksd\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"jgmn\":{\"endpoint\":\"gmwdh\",\"errorMessage\":\"buvczldbglzoutb\",\"jobServiceType\":\"qgz\",\"port\":1543957529,\"properties\":{},\"status\":\"lyzgsnor\"},\"rswhbuubpyro\":{\"endpoint\":\"otvmrxk\",\"errorMessage\":\"obvvjbhvh\",\"jobServiceType\":\"qayfl\",\"port\":307514340,\"properties\":{},\"status\":\"snuudtelvhyibdr\"},\"km\":{\"endpoint\":\"joxztfwfqchvczev\",\"errorMessage\":\"nctagfyvrtpqpem\",\"jobServiceType\":\"cgkrepdqhqy\",\"port\":1873371469,\"properties\":{},\"status\":\"mvxqab\"}},\"status\":\"NotStarted\",\"description\":\"inhgre\",\"properties\":{\"angp\":\"whlpuzjpceezn\",\"phmsexroq\":\"bfaxyxzlbc\",\"nfee\":\"ndktxfv\"},\"tags\":{\"bgnixxoww\":\"krie\",\"p\":\"kyfwnwpiwxeiicr\",\"dm\":\"pk\"}}}") - .toObject(JobScheduleAction.class); - Assertions.assertEquals("inhgre", model.jobDefinition().description()); - Assertions.assertEquals("whlpuzjpceezn", model.jobDefinition().properties().get("angp")); - Assertions.assertEquals("krie", model.jobDefinition().tags().get("bgnixxoww")); - Assertions.assertEquals("xkydfbwlja", model.jobDefinition().componentId()); - Assertions.assertEquals("uerkjddvrg", model.jobDefinition().computeId()); - Assertions.assertEquals("egftcvb", model.jobDefinition().displayName()); - Assertions.assertEquals("ftksd", model.jobDefinition().experimentName()); - Assertions.assertEquals(true, model.jobDefinition().isArchived()); - Assertions.assertEquals("gmwdh", model.jobDefinition().services().get("jgmn").endpoint()); - Assertions.assertEquals("qgz", model.jobDefinition().services().get("jgmn").jobServiceType()); - Assertions.assertEquals(1543957529, model.jobDefinition().services().get("jgmn").port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobScheduleAction model = - new JobScheduleAction() - .withJobDefinition( - new JobBaseProperties() - .withDescription("inhgre") - .withProperties(mapOf("angp", "whlpuzjpceezn", "phmsexroq", "bfaxyxzlbc", "nfee", "ndktxfv")) - .withTags(mapOf("bgnixxoww", "krie", "p", "kyfwnwpiwxeiicr", "dm", "pk")) - .withComponentId("xkydfbwlja") - .withComputeId("uerkjddvrg") - .withDisplayName("egftcvb") - .withExperimentName("ftksd") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "jgmn", - new JobService() - .withEndpoint("gmwdh") - .withJobServiceType("qgz") - .withPort(1543957529) - .withProperties(mapOf()), - "rswhbuubpyro", - new JobService() - .withEndpoint("otvmrxk") - .withJobServiceType("qayfl") - .withPort(307514340) - .withProperties(mapOf()), - "km", - new JobService() - .withEndpoint("joxztfwfqchvczev") - .withJobServiceType("cgkrepdqhqy") - .withPort(1873371469) - .withProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobScheduleAction.class); - Assertions.assertEquals("inhgre", model.jobDefinition().description()); - Assertions.assertEquals("whlpuzjpceezn", model.jobDefinition().properties().get("angp")); - Assertions.assertEquals("krie", model.jobDefinition().tags().get("bgnixxoww")); - Assertions.assertEquals("xkydfbwlja", model.jobDefinition().componentId()); - Assertions.assertEquals("uerkjddvrg", model.jobDefinition().computeId()); - Assertions.assertEquals("egftcvb", model.jobDefinition().displayName()); - Assertions.assertEquals("ftksd", model.jobDefinition().experimentName()); - Assertions.assertEquals(true, model.jobDefinition().isArchived()); - Assertions.assertEquals("gmwdh", model.jobDefinition().services().get("jgmn").endpoint()); - Assertions.assertEquals("qgz", model.jobDefinition().services().get("jgmn").jobServiceType()); - Assertions.assertEquals(1543957529, model.jobDefinition().services().get("jgmn").port()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java deleted file mode 100644 index f6f30fc8c6188..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobService model = - BinaryData - .fromString( - "{\"endpoint\":\"oaimlnw\",\"errorMessage\":\"aomylwea\",\"jobServiceType\":\"lcsethwwnpj\",\"port\":307378678,\"properties\":{\"ousnfepgfewe\":\"wpchwahf\",\"hdjhlimmbcx\":\"wlyxgncxyk\",\"cporxvxcjz\":\"h\",\"juhdqazkmtgguwpi\":\"qizxfpxtgqscjavf\"},\"status\":\"ajc\"}") - .toObject(JobService.class); - Assertions.assertEquals("oaimlnw", model.endpoint()); - Assertions.assertEquals("lcsethwwnpj", model.jobServiceType()); - Assertions.assertEquals(307378678, model.port()); - Assertions.assertEquals("wpchwahf", model.properties().get("ousnfepgfewe")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobService model = - new JobService() - .withEndpoint("oaimlnw") - .withJobServiceType("lcsethwwnpj") - .withPort(307378678) - .withProperties( - mapOf( - "ousnfepgfewe", - "wpchwahf", - "hdjhlimmbcx", - "wlyxgncxyk", - "cporxvxcjz", - "h", - "juhdqazkmtgguwpi", - "qizxfpxtgqscjavf")); - model = BinaryData.fromObject(model).toObject(JobService.class); - Assertions.assertEquals("oaimlnw", model.endpoint()); - Assertions.assertEquals("lcsethwwnpj", model.jobServiceType()); - Assertions.assertEquals(307378678, model.port()); - Assertions.assertEquals("wpchwahf", model.properties().get("ousnfepgfewe")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java deleted file mode 100644 index 23838cb4b5c83..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsCancelMockTests { - @Test - public void testCancel() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().cancel("bdxmd", "esbrujbjpppktl", "dibfmthi", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index cf71fac576b0a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"qmrpahuuonjk\",\"computeId\":\"ukguehvvp\",\"displayName\":\"oegcjoj\",\"experimentName\":\"eui\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Preparing\",\"description\":\"nhtmeplhbp\",\"properties\":{\"uc\":\"pmummmkva\",\"chxwwuzdmh\":\"jiuaiqpmnufzh\"},\"tags\":{\"mlitqdsj\":\"vivjm\",\"efndslvrqoemwsi\":\"pdviscotyxbrii\"}},\"id\":\"ailwdqmqfyd\",\"name\":\"otmfxlkdlgwgna\",\"type\":\"kuuyiuyuaf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JobBase response = - manager - .jobs() - .define("zqpl") - .withExistingWorkspace("at", "ejrnmi") - .withProperties( - new JobBaseProperties() - .withDescription("xxkwykuqdndx") - .withProperties(mapOf("gga", "h")) - .withTags(mapOf("eerscdxrnrnjrcu", "gtf", "acnrgfdtncmspsan", "mb", "b", "ame")) - .withComponentId("kihonik") - .withComputeId("r") - .withDisplayName("ffjilzfbpnt") - .withExperimentName("kensckh") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(false) - .withServices(mapOf())) - .create(); - - Assertions.assertEquals("nhtmeplhbp", response.properties().description()); - Assertions.assertEquals("pmummmkva", response.properties().properties().get("uc")); - Assertions.assertEquals("vivjm", response.properties().tags().get("mlitqdsj")); - Assertions.assertEquals("qmrpahuuonjk", response.properties().componentId()); - Assertions.assertEquals("ukguehvvp", response.properties().computeId()); - Assertions.assertEquals("oegcjoj", response.properties().displayName()); - Assertions.assertEquals("eui", response.properties().experimentName()); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java deleted file mode 100644 index 58d8aeb6fb18c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().delete("fvbennmfkbpjnr", "ekwwnthropmdudsy", "urz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java deleted file mode 100644 index 99d19faeb69b7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"yedzfzq\",\"computeId\":\"uqhtdereuno\",\"displayName\":\"kzwhpj\",\"experimentName\":\"yxedznmx\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Queued\",\"description\":\"my\",\"properties\":{\"jjtpdyzoutxfptof\":\"px\",\"gaaqw\":\"gnuywezygva\",\"lufbortb\":\"kgjpytpmpvdnoge\"},\"tags\":{\"axzs\":\"k\"}},\"id\":\"xxyjisskobqoclfl\",\"name\":\"oewyhxessmvrkd\",\"type\":\"sqeq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JobBase response = - manager - .jobs() - .getWithResponse("vktjhffecqkoq", "ouergaghp", "zxkpyehhfdyld", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("my", response.properties().description()); - Assertions.assertEquals("px", response.properties().properties().get("jjtpdyzoutxfptof")); - Assertions.assertEquals("k", response.properties().tags().get("axzs")); - Assertions.assertEquals("yedzfzq", response.properties().componentId()); - Assertions.assertEquals("uqhtdereuno", response.properties().computeId()); - Assertions.assertEquals("kzwhpj", response.properties().displayName()); - Assertions.assertEquals("yxedznmx", response.properties().experimentName()); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java deleted file mode 100644 index ae721a98aa718..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"tvzjyi\",\"computeId\":\"bqrvvbqv\",\"displayName\":\"mpe\",\"experimentName\":\"xgiqasifubn\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Completed\",\"description\":\"jnxjkht\",\"properties\":{\"xfwkz\":\"vyouweui\",\"kqytkztadopgfzdg\":\"smsfbevyllznf\"},\"tags\":{\"svloyyhigq\":\"yc\"}},\"id\":\"juqwqajq\",\"name\":\"zxpixhyo\",\"type\":\"pnfdbgsosciene\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jobs() - .list( - "hrbkhtmqowi", - "asfgqgucyhfaimqv", - "ruozkgyfp", - "oehgfmqmskkixvlz", - "xplhpeva", - ListViewType.ALL, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jnxjkht", response.iterator().next().properties().description()); - Assertions.assertEquals("vyouweui", response.iterator().next().properties().properties().get("xfwkz")); - Assertions.assertEquals("yc", response.iterator().next().properties().tags().get("svloyyhigq")); - Assertions.assertEquals("tvzjyi", response.iterator().next().properties().componentId()); - Assertions.assertEquals("bqrvvbqv", response.iterator().next().properties().computeId()); - Assertions.assertEquals("mpe", response.iterator().next().properties().displayName()); - Assertions.assertEquals("xgiqasifubn", response.iterator().next().properties().experimentName()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java deleted file mode 100644 index 8bfd89ba8ca1f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesProperties model = - BinaryData - .fromString( - "{\"relayConnectionString\":\"oyuelyetn\",\"serviceBusConnectionString\":\"bf\",\"extensionPrincipalId\":\"ggagfln\",\"extensionInstanceReleaseTrain\":\"mtrwah\",\"vcName\":\"mu\",\"namespace\":\"tb\",\"defaultInstanceType\":\"plrohkpigq\",\"instanceTypes\":{\"nmg\":{\"nodeSelector\":{\"alhhjnhgwydyynfs\":\"kzmkwklsnoxaxmqe\",\"qtanarfdlpuk\":\"khgb\",\"neizjcpe\":\"py\"},\"resources\":{\"requests\":{},\"limits\":{}}},\"f\":{\"nodeSelector\":{\"fpazjzoywjxhpd\":\"uxddbhfh\",\"tehtuevrhrljyoog\":\"lontacnpq\",\"sd\":\"xh\",\"arenlvhhtklnvnaf\":\"ugwbsreurfqkf\"},\"resources\":{\"requests\":{},\"limits\":{}}}}}") - .toObject(KubernetesProperties.class); - Assertions.assertEquals("oyuelyetn", model.relayConnectionString()); - Assertions.assertEquals("bf", model.serviceBusConnectionString()); - Assertions.assertEquals("ggagfln", model.extensionPrincipalId()); - Assertions.assertEquals("mtrwah", model.extensionInstanceReleaseTrain()); - Assertions.assertEquals("mu", model.vcName()); - Assertions.assertEquals("tb", model.namespace()); - Assertions.assertEquals("plrohkpigq", model.defaultInstanceType()); - Assertions - .assertEquals("kzmkwklsnoxaxmqe", model.instanceTypes().get("nmg").nodeSelector().get("alhhjnhgwydyynfs")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesProperties model = - new KubernetesProperties() - .withRelayConnectionString("oyuelyetn") - .withServiceBusConnectionString("bf") - .withExtensionPrincipalId("ggagfln") - .withExtensionInstanceReleaseTrain("mtrwah") - .withVcName("mu") - .withNamespace("tb") - .withDefaultInstanceType("plrohkpigq") - .withInstanceTypes( - mapOf( - "nmg", - new InstanceTypeSchema() - .withNodeSelector( - mapOf("alhhjnhgwydyynfs", "kzmkwklsnoxaxmqe", "qtanarfdlpuk", "khgb", "neizjcpe", "py")) - .withResources(new InstanceTypeSchemaResources().withRequests(mapOf()).withLimits(mapOf())), - "f", - new InstanceTypeSchema() - .withNodeSelector( - mapOf( - "fpazjzoywjxhpd", - "uxddbhfh", - "tehtuevrhrljyoog", - "lontacnpq", - "sd", - "xh", - "arenlvhhtklnvnaf", - "ugwbsreurfqkf")) - .withResources( - new InstanceTypeSchemaResources().withRequests(mapOf()).withLimits(mapOf())))); - model = BinaryData.fromObject(model).toObject(KubernetesProperties.class); - Assertions.assertEquals("oyuelyetn", model.relayConnectionString()); - Assertions.assertEquals("bf", model.serviceBusConnectionString()); - Assertions.assertEquals("ggagfln", model.extensionPrincipalId()); - Assertions.assertEquals("mtrwah", model.extensionInstanceReleaseTrain()); - Assertions.assertEquals("mu", model.vcName()); - Assertions.assertEquals("tb", model.namespace()); - Assertions.assertEquals("plrohkpigq", model.defaultInstanceType()); - Assertions - .assertEquals("kzmkwklsnoxaxmqe", model.instanceTypes().get("nmg").nodeSelector().get("alhhjnhgwydyynfs")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java deleted file mode 100644 index 453e44acde53b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import com.azure.resourcemanager.machinelearning.models.KubernetesSchema; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesSchema model = - BinaryData - .fromString( - "{\"properties\":{\"relayConnectionString\":\"j\",\"serviceBusConnectionString\":\"nuygbqeqqekewvnq\",\"extensionPrincipalId\":\"dlguaucmfdjwn\",\"extensionInstanceReleaseTrain\":\"xpunjqi\",\"vcName\":\"zvvitacgxmfcs\",\"namespace\":\"rxhtvso\",\"defaultInstanceType\":\"lwntsjgqrs\",\"instanceTypes\":{\"uuybnchrsz\":{\"nodeSelector\":{}}}}}") - .toObject(KubernetesSchema.class); - Assertions.assertEquals("j", model.properties().relayConnectionString()); - Assertions.assertEquals("nuygbqeqqekewvnq", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("dlguaucmfdjwn", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xpunjqi", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("zvvitacgxmfcs", model.properties().vcName()); - Assertions.assertEquals("rxhtvso", model.properties().namespace()); - Assertions.assertEquals("lwntsjgqrs", model.properties().defaultInstanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesSchema model = - new KubernetesSchema() - .withProperties( - new KubernetesProperties() - .withRelayConnectionString("j") - .withServiceBusConnectionString("nuygbqeqqekewvnq") - .withExtensionPrincipalId("dlguaucmfdjwn") - .withExtensionInstanceReleaseTrain("xpunjqi") - .withVcName("zvvitacgxmfcs") - .withNamespace("rxhtvso") - .withDefaultInstanceType("lwntsjgqrs") - .withInstanceTypes(mapOf("uuybnchrsz", new InstanceTypeSchema().withNodeSelector(mapOf())))); - model = BinaryData.fromObject(model).toObject(KubernetesSchema.class); - Assertions.assertEquals("j", model.properties().relayConnectionString()); - Assertions.assertEquals("nuygbqeqqekewvnq", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("dlguaucmfdjwn", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xpunjqi", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("zvvitacgxmfcs", model.properties().vcName()); - Assertions.assertEquals("rxhtvso", model.properties().namespace()); - Assertions.assertEquals("lwntsjgqrs", model.properties().defaultInstanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java deleted file mode 100644 index 57777282d3033..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.Kubernetes; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Kubernetes model = - BinaryData - .fromString( - "{\"computeType\":\"Kubernetes\",\"properties\":{\"relayConnectionString\":\"nfxofvcj\",\"serviceBusConnectionString\":\"dirazf\",\"extensionPrincipalId\":\"ejwabmdujtmvco\",\"extensionInstanceReleaseTrain\":\"xcmjurbu\",\"vcName\":\"lkyqltqsrog\",\"namespace\":\"wkffdjkt\",\"defaultInstanceType\":\"sidfv\",\"instanceTypes\":{\"n\":{\"nodeSelector\":{}}}},\"computeLocation\":\"ijtk\",\"provisioningState\":\"Succeeded\",\"description\":\"ogsf\",\"createdOn\":\"2021-05-31T19:57:24Z\",\"modifiedOn\":\"2021-02-04T08:33:30Z\",\"resourceId\":\"nsharujtjiqxfzyj\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":true}") - .toObject(Kubernetes.class); - Assertions.assertEquals("ijtk", model.computeLocation()); - Assertions.assertEquals("ogsf", model.description()); - Assertions.assertEquals("nsharujtjiqxfzyj", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("nfxofvcj", model.properties().relayConnectionString()); - Assertions.assertEquals("dirazf", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("ejwabmdujtmvco", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xcmjurbu", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("lkyqltqsrog", model.properties().vcName()); - Assertions.assertEquals("wkffdjkt", model.properties().namespace()); - Assertions.assertEquals("sidfv", model.properties().defaultInstanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Kubernetes model = - new Kubernetes() - .withComputeLocation("ijtk") - .withDescription("ogsf") - .withResourceId("nsharujtjiqxfzyj") - .withDisableLocalAuth(true) - .withProperties( - new KubernetesProperties() - .withRelayConnectionString("nfxofvcj") - .withServiceBusConnectionString("dirazf") - .withExtensionPrincipalId("ejwabmdujtmvco") - .withExtensionInstanceReleaseTrain("xcmjurbu") - .withVcName("lkyqltqsrog") - .withNamespace("wkffdjkt") - .withDefaultInstanceType("sidfv") - .withInstanceTypes(mapOf("n", new InstanceTypeSchema().withNodeSelector(mapOf())))); - model = BinaryData.fromObject(model).toObject(Kubernetes.class); - Assertions.assertEquals("ijtk", model.computeLocation()); - Assertions.assertEquals("ogsf", model.description()); - Assertions.assertEquals("nsharujtjiqxfzyj", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("nfxofvcj", model.properties().relayConnectionString()); - Assertions.assertEquals("dirazf", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("ejwabmdujtmvco", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xcmjurbu", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("lkyqltqsrog", model.properties().vcName()); - Assertions.assertEquals("wkffdjkt", model.properties().namespace()); - Assertions.assertEquals("sidfv", model.properties().defaultInstanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java deleted file mode 100644 index ba013607d7ff1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListAmlUserFeatureResult; - -public final class ListAmlUserFeatureResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListAmlUserFeatureResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"cvclxynpdk\",\"displayName\":\"fabuiyjibu\",\"description\":\"hdugneiknpg\"},{\"id\":\"gjiuqhibto\",\"displayName\":\"pqwjedm\",\"description\":\"r\"}],\"nextLink\":\"g\"}") - .toObject(ListAmlUserFeatureResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListAmlUserFeatureResult model = new ListAmlUserFeatureResult(); - model = BinaryData.fromObject(model).toObject(ListAmlUserFeatureResult.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java deleted file mode 100644 index cac57a0271876..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListUsagesResult; - -public final class ListUsagesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListUsagesResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"rvqdra\",\"amlWorkspaceLocation\":\"jybige\",\"type\":\"qfbow\",\"unit\":\"Count\",\"currentValue\":4187351799054769848,\"limit\":8321881464692032483,\"name\":{\"value\":\"iywgqywgndrvynh\",\"localizedValue\":\"pphrcgynco\"}},{\"id\":\"ecfvmm\",\"amlWorkspaceLocation\":\"ofsx\",\"type\":\"evgbmqjq\",\"unit\":\"Count\",\"currentValue\":596965066352142059,\"limit\":4744542296757351266,\"name\":{\"value\":\"zuvccfwnfnbacfio\",\"localizedValue\":\"ebxetqgtzxdp\"}}],\"nextLink\":\"bqqwxrj\"}") - .toObject(ListUsagesResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListUsagesResult model = new ListUsagesResult(); - model = BinaryData.fromObject(model).toObject(ListUsagesResult.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java deleted file mode 100644 index b8f8b806a1734..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListWorkspaceQuotas; - -public final class ListWorkspaceQuotasTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListWorkspaceQuotas model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"gidyjrrf\",\"amlWorkspaceLocation\":\"aos\",\"type\":\"xc\",\"name\":{\"value\":\"pclhocohslk\",\"localizedValue\":\"leggzfbu\"},\"limit\":5326513191162029025,\"unit\":\"Count\"},{\"id\":\"k\",\"amlWorkspaceLocation\":\"eiithlvmez\",\"type\":\"shxmzsbbzoggigrx\",\"name\":{\"value\":\"rvjx\",\"localizedValue\":\"nspydptkoenkoukn\"},\"limit\":5351704758336650999,\"unit\":\"Count\"},{\"id\":\"kbldngkpocipa\",\"amlWorkspaceLocation\":\"xoegukgjnpiucgy\",\"type\":\"vqzntypmrbpizcdr\",\"name\":{\"value\":\"dpydn\",\"localizedValue\":\"hxdeoejz\"},\"limit\":731748747615090484,\"unit\":\"Count\"}],\"nextLink\":\"ttgzfbis\"}") - .toObject(ListWorkspaceQuotas.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListWorkspaceQuotas model = new ListWorkspaceQuotas(); - model = BinaryData.fromObject(model).toObject(ListWorkspaceQuotas.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java deleted file mode 100644 index f129857a63a06..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import org.junit.jupiter.api.Assertions; - -public final class LiteralJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LiteralJobInput model = - BinaryData - .fromString("{\"jobInputType\":\"literal\",\"value\":\"mabeddqilwgdf\",\"description\":\"qfp\"}") - .toObject(LiteralJobInput.class); - Assertions.assertEquals("qfp", model.description()); - Assertions.assertEquals("mabeddqilwgdf", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LiteralJobInput model = new LiteralJobInput().withDescription("qfp").withValue("mabeddqilwgdf"); - model = BinaryData.fromObject(model).toObject(LiteralJobInput.class); - Assertions.assertEquals("qfp", model.description()); - Assertions.assertEquals("mabeddqilwgdf", model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java deleted file mode 100644 index 3ea54481c38d8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import org.junit.jupiter.api.Assertions; - -public final class MLFlowModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLFlowModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"mlflow_model\",\"mode\":\"Direct\",\"uri\":\"vdmvxadqa\",\"description\":\"rgnawbabgfbk\"}") - .toObject(MLFlowModelJobInput.class); - Assertions.assertEquals("rgnawbabgfbk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("vdmvxadqa", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLFlowModelJobInput model = - new MLFlowModelJobInput() - .withDescription("rgnawbabgfbk") - .withMode(InputDeliveryMode.DIRECT) - .withUri("vdmvxadqa"); - model = BinaryData.fromObject(model).toObject(MLFlowModelJobInput.class); - Assertions.assertEquals("rgnawbabgfbk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("vdmvxadqa", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java deleted file mode 100644 index f145c68c42973..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class MLFlowModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLFlowModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"mlflow_model\",\"mode\":\"Upload\",\"uri\":\"twmlmhjnqtqeah\",\"description\":\"dvragpokddxejhh\"}") - .toObject(MLFlowModelJobOutput.class); - Assertions.assertEquals("dvragpokddxejhh", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("twmlmhjnqtqeah", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLFlowModelJobOutput model = - new MLFlowModelJobOutput() - .withDescription("dvragpokddxejhh") - .withMode(OutputDeliveryMode.UPLOAD) - .withUri("twmlmhjnqtqeah"); - model = BinaryData.fromObject(model).toObject(MLFlowModelJobOutput.class); - Assertions.assertEquals("dvragpokddxejhh", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("twmlmhjnqtqeah", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java deleted file mode 100644 index d878fc90c2169..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLTableData; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MLTableDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableData model = - BinaryData - .fromString( - "{\"dataType\":\"mltable\",\"referencedUris\":[\"uavt\",\"tbkewkqynspg\"],\"dataUri\":\"voffbkkwvdxae\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"rlj\",\"properties\":{\"lpbcjtrpz\":\"zbnobr\",\"qelwgdhuruzytza\":\"yudivbxnhsqeaeo\",\"mpinmzvfkneerzzt\":\"ogatmoljiy\",\"bnhrxlelfjhkeiz\":\"knsjulugd\"},\"tags\":{\"wjekptycaydbj\":\"htdm\"}}") - .toObject(MLTableData.class); - Assertions.assertEquals("rlj", model.description()); - Assertions.assertEquals("zbnobr", model.properties().get("lpbcjtrpz")); - Assertions.assertEquals("htdm", model.tags().get("wjekptycaydbj")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("voffbkkwvdxae", model.dataUri()); - Assertions.assertEquals("uavt", model.referencedUris().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableData model = - new MLTableData() - .withDescription("rlj") - .withProperties( - mapOf( - "lpbcjtrpz", - "zbnobr", - "qelwgdhuruzytza", - "yudivbxnhsqeaeo", - "mpinmzvfkneerzzt", - "ogatmoljiy", - "bnhrxlelfjhkeiz", - "knsjulugd")) - .withTags(mapOf("wjekptycaydbj", "htdm")) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("voffbkkwvdxae") - .withReferencedUris(Arrays.asList("uavt", "tbkewkqynspg")); - model = BinaryData.fromObject(model).toObject(MLTableData.class); - Assertions.assertEquals("rlj", model.description()); - Assertions.assertEquals("zbnobr", model.properties().get("lpbcjtrpz")); - Assertions.assertEquals("htdm", model.tags().get("wjekptycaydbj")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("voffbkkwvdxae", model.dataUri()); - Assertions.assertEquals("uavt", model.referencedUris().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java deleted file mode 100644 index b3dc0b4dc534e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import org.junit.jupiter.api.Assertions; - -public final class MLTableJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"pqinf\",\"description\":\"pyglqdhmrjzral\"}") - .toObject(MLTableJobInput.class); - Assertions.assertEquals("pyglqdhmrjzral", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("pqinf", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableJobInput model = - new MLTableJobInput().withDescription("pyglqdhmrjzral").withMode(InputDeliveryMode.DIRECT).withUri("pqinf"); - model = BinaryData.fromObject(model).toObject(MLTableJobInput.class); - Assertions.assertEquals("pyglqdhmrjzral", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("pqinf", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java deleted file mode 100644 index 5c66587aba526..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLTableJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class MLTableJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"mlcfnzhmhsurl\",\"description\":\"qkpmmzpstau\"}") - .toObject(MLTableJobOutput.class); - Assertions.assertEquals("qkpmmzpstau", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("mlcfnzhmhsurl", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableJobOutput model = - new MLTableJobOutput() - .withDescription("qkpmmzpstau") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("mlcfnzhmhsurl"); - model = BinaryData.fromObject(model).toObject(MLTableJobOutput.class); - Assertions.assertEquals("qkpmmzpstau", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("mlcfnzhmhsurl", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java deleted file mode 100644 index cd00ea9d950cf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedIdentity; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class ManagedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedIdentity model = - BinaryData - .fromString( - "{\"identityType\":\"Managed\",\"clientId\":\"49930aac-491a-4ce3-99bb-f763f6db3ac3\",\"objectId\":\"2fd57264-6306-4a7e-bd5d-0d45048516e5\",\"resourceId\":\"clg\"}") - .toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3"), model.clientId()); - Assertions.assertEquals(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5"), model.objectId()); - Assertions.assertEquals("clg", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedIdentity model = - new ManagedIdentity() - .withClientId(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3")) - .withObjectId(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5")) - .withResourceId("clg"); - model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3"), model.clientId()); - Assertions.assertEquals(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5"), model.objectId()); - Assertions.assertEquals("clg", model.resourceId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 1109f7fc49d4e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"eedebc97-7cf9-49d6-8058-af89513b30b7\",\"tenantId\":\"022e8374-0d41-4bc5-8365-0eb3372a635f\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ginuvamih\":{\"principalId\":\"f6324d70-bc8b-4552-95e1-03d0c14617f7\",\"clientId\":\"334d5ff8-4410-4858-b84d-54862312e602\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("ginuvamih", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java deleted file mode 100644 index 36f27a2eb5f25..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; -import org.junit.jupiter.api.Assertions; - -public final class MedianStoppingPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MedianStoppingPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"MedianStopping\",\"delayEvaluation\":2026820948,\"evaluationInterval\":660103653}") - .toObject(MedianStoppingPolicy.class); - Assertions.assertEquals(2026820948, model.delayEvaluation()); - Assertions.assertEquals(660103653, model.evaluationInterval()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MedianStoppingPolicy model = - new MedianStoppingPolicy().withDelayEvaluation(2026820948).withEvaluationInterval(660103653); - model = BinaryData.fromObject(model).toObject(MedianStoppingPolicy.class); - Assertions.assertEquals(2026820948, model.delayEvaluation()); - Assertions.assertEquals(660103653, model.evaluationInterval()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java deleted file mode 100644 index b1dce75cdfb41..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"gaqvlgafcqusrd\",\"nextVersion\":\"t\",\"description\":\"sdtutnwlduyc\",\"properties\":{\"kuqgsjjxundxgket\":\"hyrmewipmvekdx\",\"gpmuneqsxvmhfbuz\":\"zhhzjhfjmhvvmu\",\"ms\":\"yihsasbhudypohyu\"},\"tags\":{\"pfoobr\":\"sqy\",\"qdnfwqzdz\":\"ttymsjny\",\"fhqlyvi\":\"tilaxh\",\"ti\":\"ouwivkxoyzunbixx\"}},\"id\":\"cpwpg\",\"name\":\"lrcivtsoxfrke\",\"type\":\"xpmyyefrpmpdnq\"}") - .toObject(ModelContainerInner.class); - Assertions.assertEquals("sdtutnwlduyc", model.properties().description()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().properties().get("kuqgsjjxundxgket")); - Assertions.assertEquals("sqy", model.properties().tags().get("pfoobr")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerInner model = - new ModelContainerInner() - .withProperties( - new ModelContainerProperties() - .withDescription("sdtutnwlduyc") - .withProperties( - mapOf( - "kuqgsjjxundxgket", - "hyrmewipmvekdx", - "gpmuneqsxvmhfbuz", - "zhhzjhfjmhvvmu", - "ms", - "yihsasbhudypohyu")) - .withTags( - mapOf( - "pfoobr", - "sqy", - "qdnfwqzdz", - "ttymsjny", - "fhqlyvi", - "tilaxh", - "ti", - "ouwivkxoyzunbixx")) - .withIsArchived(false)); - model = BinaryData.fromObject(model).toObject(ModelContainerInner.class); - Assertions.assertEquals("sdtutnwlduyc", model.properties().description()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().properties().get("kuqgsjjxundxgket")); - Assertions.assertEquals("sqy", model.properties().tags().get("pfoobr")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java deleted file mode 100644 index db0008fce8e14..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"waoqvmmb\",\"nextVersion\":\"qfr\",\"description\":\"lkzmegnitgvkxl\",\"properties\":{\"gcealzxwh\":\"drf\",\"yqhlwigdivbkbx\":\"ansym\",\"wasqvdaeyyg\":\"omfaj\",\"zkgimsid\":\"xakjsqzhzb\"},\"tags\":{\"hpqgatjeaahhvj\":\"icddyvvjskgfmocw\",\"jjidjk\":\"hnakzyb\"}}") - .toObject(ModelContainerProperties.class); - Assertions.assertEquals("lkzmegnitgvkxl", model.description()); - Assertions.assertEquals("drf", model.properties().get("gcealzxwh")); - Assertions.assertEquals("icddyvvjskgfmocw", model.tags().get("hpqgatjeaahhvj")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerProperties model = - new ModelContainerProperties() - .withDescription("lkzmegnitgvkxl") - .withProperties( - mapOf( - "gcealzxwh", - "drf", - "yqhlwigdivbkbx", - "ansym", - "wasqvdaeyyg", - "omfaj", - "zkgimsid", - "xakjsqzhzb")) - .withTags(mapOf("hpqgatjeaahhvj", "icddyvvjskgfmocw", "jjidjk", "hnakzyb")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(ModelContainerProperties.class); - Assertions.assertEquals("lkzmegnitgvkxl", model.description()); - Assertions.assertEquals("drf", model.properties().get("gcealzxwh")); - Assertions.assertEquals("icddyvvjskgfmocw", model.tags().get("hpqgatjeaahhvj")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index f1278bd93c0a8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import com.azure.resourcemanager.machinelearning.models.ModelContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"m\",\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"iwrxgkn\",\"nextVersion\":\"vyi\",\"description\":\"qodfvp\",\"properties\":{},\"tags\":{}},\"id\":\"xgsg\",\"name\":\"p\",\"type\":\"gzdjtxvzf\"}]}") - .toObject(ModelContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("m", model.nextLink()); - Assertions.assertEquals("qodfvp", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerResourceArmPaginatedResult model = - new ModelContainerResourceArmPaginatedResult() - .withNextLink("m") - .withValue( - Arrays - .asList( - new ModelContainerInner() - .withProperties( - new ModelContainerProperties() - .withDescription("qodfvp") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false)))); - model = BinaryData.fromObject(model).toObject(ModelContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("m", model.nextLink()); - Assertions.assertEquals("qodfvp", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index da6ac506a5730..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ucfzluczdquu\",\"nextVersion\":\"ormvh\",\"description\":\"ielbprnq\",\"properties\":{\"nwsvhbngqiwye\":\"wzcqygg\",\"kunsbfjhhlwtpkv\":\"tobdrrpnre\",\"z\":\"geattbzkg\"},\"tags\":{\"x\":\"qsttewuvcysjeuf\",\"uxlvrhprrvbwonl\":\"lpditfnonpi\",\"huy\":\"qflvtlrvbst\"}},\"id\":\"n\",\"name\":\"nttlnrjd\",\"type\":\"zdbuzici\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelContainer response = - manager - .modelContainers() - .define("iuepmaxfnzlpqmp") - .withExistingWorkspace("kvy", "fbqvumkxqj") - .withProperties( - new ModelContainerProperties() - .withDescription("rhfcaeooifqdyw") - .withProperties(mapOf("corkfrocgbmxl", "obhahqmomf", "zezbjes", "j")) - .withTags(mapOf("fygpnyhgd", "lurb", "a", "uqs", "y", "qyvoupr")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("ielbprnq", response.properties().description()); - Assertions.assertEquals("wzcqygg", response.properties().properties().get("nwsvhbngqiwye")); - Assertions.assertEquals("qsttewuvcysjeuf", response.properties().tags().get("x")); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java deleted file mode 100644 index e845861d1b84d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .modelContainers() - .deleteWithResponse("dwsngkr", "ihscjvakmhzbhw", "hf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java deleted file mode 100644 index ad48156c20db2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"yrletndqlmf\",\"nextVersion\":\"gnbbuypwovvvsfle\",\"description\":\"noqayrehjuqwvap\",\"properties\":{\"qzubfonfd\":\"zhpzihacenqqzlx\",\"jcw\":\"gmkfw\",\"zl\":\"ewfhxwyrkbre\"},\"tags\":{\"mkaeplrajubow\":\"jpch\",\"aoklfnis\":\"ywevtjrieikmw\",\"tjcyyuv\":\"xgucbmtredscnn\",\"ecwwtz\":\"zrxzhc\"}},\"id\":\"cloyhy\",\"name\":\"pgidhzgyresgzsdt\",\"type\":\"wbyorjplbchych\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelContainer response = - manager - .modelContainers() - .getWithResponse("wihbnnxemv", "nuqqkotauratnicp", "fzs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("noqayrehjuqwvap", response.properties().description()); - Assertions.assertEquals("zhpzihacenqqzlx", response.properties().properties().get("qzubfonfd")); - Assertions.assertEquals("jpch", response.properties().tags().get("mkaeplrajubow")); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java deleted file mode 100644 index 2dfc509206074..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"d\",\"nextVersion\":\"palvngtw\",\"description\":\"skwgqr\",\"properties\":{\"zuppiyx\":\"umdrcjlvkrkegty\"},\"tags\":{\"eqzqvabmhvs\":\"iydd\",\"ewxtrl\":\"xduetbapfc\",\"kjpirgzxvbczw\":\"bpxya\",\"i\":\"yegbthms\"}},\"id\":\"buiggrunozf\",\"name\":\"u\",\"type\":\"ljthoiv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .modelContainers() - .list("xlxicwgp", "hdcfm", "z", 1474735813, ListViewType.ACTIVE_ONLY, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("skwgqr", response.iterator().next().properties().description()); - Assertions.assertEquals("umdrcjlvkrkegty", response.iterator().next().properties().properties().get("zuppiyx")); - Assertions.assertEquals("iydd", response.iterator().next().properties().tags().get("eqzqvabmhvs")); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java deleted file mode 100644 index 7c9bfac16a2e8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"flavors\":{\"ckknhxkizvy\":{\"data\":{}},\"rzvul\":{\"data\":{}},\"aaeranokqgukk\":{\"data\":{}},\"nvbroylaxx\":{\"data\":{}}},\"jobName\":\"cdisd\",\"modelType\":\"fj\",\"modelUri\":\"svgjrwhryvy\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"xgccknfnw\",\"properties\":{\"dxihc\":\"mvpdvjdhttzaef\",\"bg\":\"rphkmcrjdqnsdfz\",\"euutlwxezwzh\":\"gkylkdghr\"},\"tags\":{\"ehgpp\":\"bwnhhtql\",\"csheafidltugsr\":\"pifhpfeoajvgcxtx\"}},\"id\":\"mks\",\"name\":\"jhoiftxfkfweg\",\"type\":\"rhptilluc\"}") - .toObject(ModelVersionInner.class); - Assertions.assertEquals("xgccknfnw", model.properties().description()); - Assertions.assertEquals("mvpdvjdhttzaef", model.properties().properties().get("dxihc")); - Assertions.assertEquals("bwnhhtql", model.properties().tags().get("ehgpp")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("cdisd", model.properties().jobName()); - Assertions.assertEquals("fj", model.properties().modelType()); - Assertions.assertEquals("svgjrwhryvy", model.properties().modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionInner model = - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("xgccknfnw") - .withProperties( - mapOf("dxihc", "mvpdvjdhttzaef", "bg", "rphkmcrjdqnsdfz", "euutlwxezwzh", "gkylkdghr")) - .withTags(mapOf("ehgpp", "bwnhhtql", "csheafidltugsr", "pifhpfeoajvgcxtx")) - .withIsAnonymous(false) - .withIsArchived(false) - .withFlavors( - mapOf( - "ckknhxkizvy", - new FlavorData().withData(mapOf()), - "rzvul", - new FlavorData().withData(mapOf()), - "aaeranokqgukk", - new FlavorData().withData(mapOf()), - "nvbroylaxx", - new FlavorData().withData(mapOf()))) - .withJobName("cdisd") - .withModelType("fj") - .withModelUri("svgjrwhryvy")); - model = BinaryData.fromObject(model).toObject(ModelVersionInner.class); - Assertions.assertEquals("xgccknfnw", model.properties().description()); - Assertions.assertEquals("mvpdvjdhttzaef", model.properties().properties().get("dxihc")); - Assertions.assertEquals("bwnhhtql", model.properties().tags().get("ehgpp")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("cdisd", model.properties().jobName()); - Assertions.assertEquals("fj", model.properties().modelType()); - Assertions.assertEquals("svgjrwhryvy", model.properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java deleted file mode 100644 index ebd2e8723618e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionProperties model = - BinaryData - .fromString( - "{\"flavors\":{\"a\":{\"data\":{\"sldrizetpwbral\":\"dqohmc\",\"qzmiza\":\"libph\"}},\"thwtzol\":{\"data\":{\"lhjlmuoyxprimr\":\"kjpdnjzhajo\",\"eislstvasylwx\":\"opteecj\",\"eoohguufuzboyj\":\"zaum\"}},\"zaapmudqmeqwi\":{\"data\":{\"lxveabfqx\":\"mwmdxmebwjscjpa\",\"ijddtvqc\":\"mwmqtibx\",\"jaeukmrsieekpn\":\"tad\"}}},\"jobName\":\"ibudqwy\",\"modelType\":\"beybpmzznrtffyaq\",\"modelUri\":\"mhh\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"hvseufuqyrx\",\"properties\":{\"sismjqfrddga\":\"cgq\",\"disyirnxz\":\"quhiosrsjuivf\",\"revkhgnlnzo\":\"czexrxzbujrtrhqv\"},\"tags\":{\"tszcofizehtdhgb\":\"rpiqywncv\",\"reljeamur\":\"k\",\"xlpm\":\"zmlovuanash\"}}") - .toObject(ModelVersionProperties.class); - Assertions.assertEquals("hvseufuqyrx", model.description()); - Assertions.assertEquals("cgq", model.properties().get("sismjqfrddga")); - Assertions.assertEquals("rpiqywncv", model.tags().get("tszcofizehtdhgb")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("dqohmc", model.flavors().get("a").data().get("sldrizetpwbral")); - Assertions.assertEquals("ibudqwy", model.jobName()); - Assertions.assertEquals("beybpmzznrtffyaq", model.modelType()); - Assertions.assertEquals("mhh", model.modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionProperties model = - new ModelVersionProperties() - .withDescription("hvseufuqyrx") - .withProperties( - mapOf("sismjqfrddga", "cgq", "disyirnxz", "quhiosrsjuivf", "revkhgnlnzo", "czexrxzbujrtrhqv")) - .withTags(mapOf("tszcofizehtdhgb", "rpiqywncv", "reljeamur", "k", "xlpm", "zmlovuanash")) - .withIsAnonymous(true) - .withIsArchived(false) - .withFlavors( - mapOf( - "a", - new FlavorData().withData(mapOf("sldrizetpwbral", "dqohmc", "qzmiza", "libph")), - "thwtzol", - new FlavorData() - .withData( - mapOf( - "lhjlmuoyxprimr", - "kjpdnjzhajo", - "eislstvasylwx", - "opteecj", - "eoohguufuzboyj", - "zaum")), - "zaapmudqmeqwi", - new FlavorData() - .withData( - mapOf( - "lxveabfqx", "mwmdxmebwjscjpa", "ijddtvqc", "mwmqtibx", "jaeukmrsieekpn", "tad")))) - .withJobName("ibudqwy") - .withModelType("beybpmzznrtffyaq") - .withModelUri("mhh"); - model = BinaryData.fromObject(model).toObject(ModelVersionProperties.class); - Assertions.assertEquals("hvseufuqyrx", model.description()); - Assertions.assertEquals("cgq", model.properties().get("sismjqfrddga")); - Assertions.assertEquals("rpiqywncv", model.tags().get("tszcofizehtdhgb")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("dqohmc", model.flavors().get("a").data().get("sldrizetpwbral")); - Assertions.assertEquals("ibudqwy", model.jobName()); - Assertions.assertEquals("beybpmzznrtffyaq", model.modelType()); - Assertions.assertEquals("mhh", model.modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index bc48204938a5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"xkyxvxevblbj\",\"value\":[{\"properties\":{\"flavors\":{},\"jobName\":\"lageuaulxun\",\"modelType\":\"jbnkpp\",\"modelUri\":\"nenlsvxeizzg\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"mffeycxcktpi\",\"properties\":{},\"tags\":{}},\"id\":\"teeammxqiekkkzd\",\"name\":\"rtkgdojbmxvavref\",\"type\":\"eesvecu\"},{\"properties\":{\"flavors\":{},\"jobName\":\"xtxsuwprtujw\",\"modelType\":\"wddji\",\"modelUri\":\"bxv\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"zeexavoxtfgle\",\"properties\":{},\"tags\":{}},\"id\":\"qbw\",\"name\":\"ypq\",\"type\":\"gsfjac\"},{\"properties\":{\"flavors\":{},\"jobName\":\"hhxud\",\"modelType\":\"vodhtn\",\"modelUri\":\"rudhzmmesckdl\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"x\",\"properties\":{},\"tags\":{}},\"id\":\"cfxwmdbox\",\"name\":\"fgsftufqob\",\"type\":\"jln\"}]}") - .toObject(ModelVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("xkyxvxevblbj", model.nextLink()); - Assertions.assertEquals("mffeycxcktpi", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("lageuaulxun", model.value().get(0).properties().jobName()); - Assertions.assertEquals("jbnkpp", model.value().get(0).properties().modelType()); - Assertions.assertEquals("nenlsvxeizzg", model.value().get(0).properties().modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionResourceArmPaginatedResult model = - new ModelVersionResourceArmPaginatedResult() - .withNextLink("xkyxvxevblbj") - .withValue( - Arrays - .asList( - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("mffeycxcktpi") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("lageuaulxun") - .withModelType("jbnkpp") - .withModelUri("nenlsvxeizzg")), - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("zeexavoxtfgle") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withFlavors(mapOf()) - .withJobName("xtxsuwprtujw") - .withModelType("wddji") - .withModelUri("bxv")), - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("x") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("hhxud") - .withModelType("vodhtn") - .withModelUri("rudhzmmesckdl")))); - model = BinaryData.fromObject(model).toObject(ModelVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("xkyxvxevblbj", model.nextLink()); - Assertions.assertEquals("mffeycxcktpi", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("lageuaulxun", model.value().get(0).properties().jobName()); - Assertions.assertEquals("jbnkpp", model.value().get(0).properties().modelType()); - Assertions.assertEquals("nenlsvxeizzg", model.value().get(0).properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c8e1e71d6e400..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"flavors\":{},\"jobName\":\"icjuft\",\"modelType\":\"iooanduewfhv\",\"modelUri\":\"jhxzubfjzabbwzgv\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"dckixspsaigavkmv\",\"properties\":{\"yetjxryo\":\"erejrkpzj\",\"pemnrrabo\":\"taeitwhlbecgihz\"},\"tags\":{\"pskpeswyhhmif\":\"wxywpjhspboxhif\",\"y\":\"uajxwwvcmmpeg\",\"exbzbqufpnezsjza\":\"qvcml\",\"dror\":\"m\"}},\"id\":\"ogzmsimehtcuuwdh\",\"name\":\"qqhyhnimxtns\",\"type\":\"gi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelVersion response = - manager - .modelVersions() - .define("nmxynlsuqbwzst") - .withExistingModel("tfbjampq", "c", "a") - .withProperties( - new ModelVersionProperties() - .withDescription("okr") - .withProperties( - mapOf( - "pujzfl", "sgaojbtqpqsdoctp", "wlluunxhfwlfxz", "cdsgxceluji", "eupcknecexkgrv", "wu")) - .withTags( - mapOf( - "wawoxcgzbejqf", - "jdmngsytqpdzfyxc", - "xdwdrpazqjkrfm", - "ifopf", - "gtji", - "wotfcuu", - "cjjkmqenh", - "pgayiawohfmhnnzm")) - .withIsAnonymous(false) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("vpatrgjjk") - .withModelType("i") - .withModelUri("hoksmmculwk")) - .create(); - - Assertions.assertEquals("dckixspsaigavkmv", response.properties().description()); - Assertions.assertEquals("erejrkpzj", response.properties().properties().get("yetjxryo")); - Assertions.assertEquals("wxywpjhspboxhif", response.properties().tags().get("pskpeswyhhmif")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("icjuft", response.properties().jobName()); - Assertions.assertEquals("iooanduewfhv", response.properties().modelType()); - Assertions.assertEquals("jhxzubfjzabbwzgv", response.properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index ccb3cf60148a0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .modelVersions() - .deleteWithResponse( - "rmuhcuhtuzlx", "wyopgarpfctwrapc", "dojq", "vzesipiys", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java deleted file mode 100644 index 4e24bc5af0c30..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"flavors\":{},\"jobName\":\"yrkqa\",\"modelType\":\"fajfreprfvmki\",\"modelUri\":\"teyrqshi\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"pylblfsprrwc\",\"properties\":{\"rdytzfslxizhq\":\"mtcvvf\",\"cdiiisklbonx\":\"kmgobliqe\"},\"tags\":{\"wkosnyxigf\":\"jxvtrkfkgenjqnnp\",\"kwopswnyinxupr\":\"ujjcxgdqmrlhn\",\"uekdcpvu\":\"xyxwjezbfqplo\"}},\"id\":\"rsvjmnsvujnjktv\",\"name\":\"lefcjis\",\"type\":\"pkdbx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelVersion response = - manager - .modelVersions() - .getWithResponse( - "jqyowaadc", "dazabundtse", "kaupwhlz", "ckremgjlmsvdorsi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pylblfsprrwc", response.properties().description()); - Assertions.assertEquals("mtcvvf", response.properties().properties().get("rdytzfslxizhq")); - Assertions.assertEquals("jxvtrkfkgenjqnnp", response.properties().tags().get("wkosnyxigf")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("yrkqa", response.properties().jobName()); - Assertions.assertEquals("fajfreprfvmki", response.properties().modelType()); - Assertions.assertEquals("teyrqshi", response.properties().modelUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java deleted file mode 100644 index 3ce927ed9a2aa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"flavors\":{},\"jobName\":\"cjiwgsxfaio\",\"modelType\":\"dgujjgnfgrzxbarc\",\"modelUri\":\"aefzqsy\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"cytesmf\",\"properties\":{\"uauzmz\":\"tfodq\"},\"tags\":{\"udxdyyrudmahswt\":\"trfzhhezvh\",\"sgfenffdxb\":\"dkxbq\"}},\"id\":\"fqjchivdrij\",\"name\":\"nxndmuvardlmzjo\",\"type\":\"p\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .modelVersions() - .list( - "ppoqvgpnewuhwfwj", - "oxuo", - "tfnressfepgck", - "cjmgvsnvbtqdxfm", - "ym", - 253482079, - "hjluqllbsupubdx", - "kdlhzwhc", - 1124583033, - "vbosjj", - "dizhrjqfyaytvsly", - "kcgn", - ListViewType.ARCHIVED_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cytesmf", response.iterator().next().properties().description()); - Assertions.assertEquals("tfodq", response.iterator().next().properties().properties().get("uauzmz")); - Assertions.assertEquals("trfzhhezvh", response.iterator().next().properties().tags().get("udxdyyrudmahswt")); - Assertions.assertEquals(false, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions.assertEquals("cjiwgsxfaio", response.iterator().next().properties().jobName()); - Assertions.assertEquals("dgujjgnfgrzxbarc", response.iterator().next().properties().modelType()); - Assertions.assertEquals("aefzqsy", response.iterator().next().properties().modelUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java deleted file mode 100644 index 44975c7627f61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Mpi; -import org.junit.jupiter.api.Assertions; - -public final class MpiTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Mpi model = - BinaryData - .fromString("{\"distributionType\":\"Mpi\",\"processCountPerInstance\":589201934}") - .toObject(Mpi.class); - Assertions.assertEquals(589201934, model.processCountPerInstance()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Mpi model = new Mpi().withProcessCountPerInstance(589201934); - model = BinaryData.fromObject(model).toObject(Mpi.class); - Assertions.assertEquals(589201934, model.processCountPerInstance()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java deleted file mode 100644 index a68e62ee8d8bf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; - -public final class NCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NCrossValidations model = - BinaryData.fromString("{\"mode\":\"NCrossValidations\"}").toObject(NCrossValidations.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NCrossValidations model = new NCrossValidations(); - model = BinaryData.fromObject(model).toObject(NCrossValidations.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java deleted file mode 100644 index 2ee39e50710c6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalFeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVerticalFeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"ns\"}").toObject(NlpVerticalFeaturizationSettings.class); - Assertions.assertEquals("ns", model.datasetLanguage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVerticalFeaturizationSettings model = new NlpVerticalFeaturizationSettings().withDatasetLanguage("ns"); - model = BinaryData.fromObject(model).toObject(NlpVerticalFeaturizationSettings.class); - Assertions.assertEquals("ns", model.datasetLanguage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java deleted file mode 100644 index 772b65dcba64f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVerticalLimitSettings model = - BinaryData - .fromString("{\"maxConcurrentTrials\":422661668,\"maxTrials\":768209268,\"timeout\":\"PT230H9M19S\"}") - .toObject(NlpVerticalLimitSettings.class); - Assertions.assertEquals(422661668, model.maxConcurrentTrials()); - Assertions.assertEquals(768209268, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVerticalLimitSettings model = - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(422661668) - .withMaxTrials(768209268) - .withTimeout(Duration.parse("PT230H9M19S")); - model = BinaryData.fromObject(model).toObject(NlpVerticalLimitSettings.class); - Assertions.assertEquals(422661668, model.maxConcurrentTrials()); - Assertions.assertEquals(768209268, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java deleted file mode 100644 index e9e0709289f0b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVertical; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVertical model = - BinaryData - .fromString( - "{\"featurizationSettings\":{\"datasetLanguage\":\"ubmomsgvvjh\"},\"limitSettings\":{\"maxConcurrentTrials\":1113718862,\"maxTrials\":1386794835,\"timeout\":\"PT207H58M31S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"majnkd\",\"description\":\"q\"}}") - .toObject(NlpVertical.class); - Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1386794835, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout()); - Assertions.assertEquals("q", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("majnkd", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVertical model = - new NlpVertical() - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("ubmomsgvvjh")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1113718862) - .withMaxTrials(1386794835) - .withTimeout(Duration.parse("PT207H58M31S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("q") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("majnkd")); - model = BinaryData.fromObject(model).toObject(NlpVertical.class); - Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1386794835, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout()); - Assertions.assertEquals("q", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("majnkd", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java deleted file mode 100644 index a7c0d6a48f646..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NodeStateCounts; - -public final class NodeStateCountsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeStateCounts model = - BinaryData - .fromString( - "{\"idleNodeCount\":1191856604,\"runningNodeCount\":715935859,\"preparingNodeCount\":2047901283,\"unusableNodeCount\":1346181735,\"leavingNodeCount\":1358224808,\"preemptedNodeCount\":304822445}") - .toObject(NodeStateCounts.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeStateCounts model = new NodeStateCounts(); - model = BinaryData.fromObject(model).toObject(NodeStateCounts.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java deleted file mode 100644 index 5eae0e57bdc61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import org.junit.jupiter.api.Assertions; - -public final class NoneAuthTypeWorkspaceConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NoneAuthTypeWorkspaceConnectionProperties model = - BinaryData - .fromString( - "{\"authType\":\"None\",\"category\":\"Git\",\"target\":\"lazipbhpwvq\",\"value\":\"ny\",\"valueFormat\":\"JSON\"}") - .toObject(NoneAuthTypeWorkspaceConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.GIT, model.category()); - Assertions.assertEquals("lazipbhpwvq", model.target()); - Assertions.assertEquals("ny", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NoneAuthTypeWorkspaceConnectionProperties model = - new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.GIT) - .withTarget("lazipbhpwvq") - .withValue("ny") - .withValueFormat(ValueFormat.JSON); - model = BinaryData.fromObject(model).toObject(NoneAuthTypeWorkspaceConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.GIT, model.category()); - Assertions.assertEquals("lazipbhpwvq", model.target()); - Assertions.assertEquals("ny", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java deleted file mode 100644 index 9dd9d12151240..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Goal; -import com.azure.resourcemanager.machinelearning.models.Objective; -import org.junit.jupiter.api.Assertions; - -public final class ObjectiveTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Objective model = - BinaryData - .fromString("{\"goal\":\"Minimize\",\"primaryMetric\":\"qxjoshohtotryeg\"}") - .toObject(Objective.class); - Assertions.assertEquals(Goal.MINIMIZE, model.goal()); - Assertions.assertEquals("qxjoshohtotryeg", model.primaryMetric()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Objective model = new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("qxjoshohtotryeg"); - model = BinaryData.fromObject(model).toObject(Objective.class); - Assertions.assertEquals(Goal.MINIMIZE, model.goal()); - Assertions.assertEquals("qxjoshohtotryeg", model.primaryMetric()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index a326c433a7b9f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.OnlineDeploymentInner; -import com.azure.resourcemanager.machinelearning.models.EgressPublicNetworkAccessType; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineDeploymentProperties; -import com.azure.resourcemanager.machinelearning.models.OnlineDeploymentTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OnlineDeploymentTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"rprsnm\",\"value\":[{\"identity\":{\"principalId\":\"4da85e2a-d4e0-4d4c-95ab-041badbdf8b9\",\"tenantId\":\"16df482c-d39e-4be2-9abe-ddba471908e5\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"lbkpb\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":false,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"jh\",\"model\":\"vechndbnwiehole\",\"modelMountPath\":\"wiuub\",\"provisioningState\":\"Succeeded\",\"description\":\"aqtferr\",\"environmentId\":\"ex\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"xap\",\"tier\":\"Free\",\"size\":\"qqnobpudcd\",\"family\":\"tqwpwya\",\"capacity\":2036163978},\"location\":\"sqbuc\",\"tags\":{\"sdaultxij\":\"kyexaoguyaipi\",\"qwazlnqnmcjngzq\":\"um\",\"sf\":\"qxtbjwgnyf\"},\"id\":\"svtui\",\"name\":\"zh\",\"type\":\"jqg\"},{\"identity\":{\"principalId\":\"0ddd2460-1f6c-4ca7-a3bb-8be70bc2fc6a\",\"tenantId\":\"a55475da-8d74-41aa-b7bd-fc2075054554\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"qryxyn\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":true,\"egressPublicNetworkAccess\":\"Disabled\",\"instanceType\":\"sovwxznptgoeiyb\",\"model\":\"pfhvfslk\",\"modelMountPath\":\"tjlrigjksky\",\"provisioningState\":\"Creating\",\"description\":\"sxwaabzm\",\"environmentId\":\"rygznmmaxriz\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"gopxlhslnelxie\",\"tier\":\"Basic\",\"size\":\"llxecwc\",\"family\":\"jphslhcaw\",\"capacity\":224494261},\"location\":\"fdwfmvigorqj\",\"tags\":{\"n\":\"zhraglkafh\"},\"id\":\"juj\",\"name\":\"ickpz\",\"type\":\"cpopmxel\"},{\"identity\":{\"principalId\":\"0f14930d-5df5-4097-9b70-8c82d3a4bfcb\",\"tenantId\":\"bbf6d45e-ad6b-4e4a-97f7-a7c3941dcbf1\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"edexxmlfm\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":true,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"uawxtzx\",\"model\":\"mwabzxrvxc\",\"modelMountPath\":\"hsphaivmxyas\",\"provisioningState\":\"Deleting\",\"description\":\"ywakoihk\",\"environmentId\":\"mjblmljhlny\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"qyryuzcbmqqvxm\",\"tier\":\"Standard\",\"size\":\"tayx\",\"family\":\"supe\",\"capacity\":2074822274},\"location\":\"qnhcvsqltnzoibg\",\"tags\":{\"qoxwd\":\"nxfyqonm\"},\"id\":\"fdbxiqxeiiqbim\",\"name\":\"tmwwi\",\"type\":\"h\"},{\"identity\":{\"principalId\":\"8b9a4105-dd9b-43ff-91e1-ba1a28c9f57b\",\"tenantId\":\"2a050a31-f610-475f-948f-53b51c0d42ca\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"vwbcblembnkbwv\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":false,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"vqihebwtswbzuwf\",\"model\":\"ragegi\",\"modelMountPath\":\"cjfelisdjubgg\",\"provisioningState\":\"Failed\",\"description\":\"sazgakgacyrcmj\",\"environmentId\":\"spofapvuhry\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"frzgbzjed\",\"tier\":\"Premium\",\"size\":\"vnlvxbcuiiznktwf\",\"family\":\"snvpdibmi\",\"capacity\":1037622433},\"location\":\"bzbkiw\",\"tags\":{\"ophzfylsgcrp\":\"n\",\"fwyfwlwxjwet\":\"bcunezzceze\",\"zvaylptrsqqw\":\"psihcla\"},\"id\":\"tcmwqkchc\",\"name\":\"waxfewzjkj\",\"type\":\"xfdeqvhpsyl\"}]}") - .toObject(OnlineDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("rprsnm", model.nextLink()); - Assertions.assertEquals("sqbuc", model.value().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", model.value().get(0).tags().get("sdaultxij")); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lbkpb", model.value().get(0).kind()); - Assertions.assertEquals("aqtferr", model.value().get(0).properties().description()); - Assertions.assertEquals("ex", model.value().get(0).properties().environmentId()); - Assertions.assertEquals(false, model.value().get(0).properties().appInsightsEnabled()); - Assertions - .assertEquals( - EgressPublicNetworkAccessType.ENABLED, model.value().get(0).properties().egressPublicNetworkAccess()); - Assertions.assertEquals("jh", model.value().get(0).properties().instanceType()); - Assertions.assertEquals("vechndbnwiehole", model.value().get(0).properties().model()); - Assertions.assertEquals("wiuub", model.value().get(0).properties().modelMountPath()); - Assertions.assertEquals("xap", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("qqnobpudcd", model.value().get(0).sku().size()); - Assertions.assertEquals("tqwpwya", model.value().get(0).sku().family()); - Assertions.assertEquals(2036163978, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineDeploymentTrackedResourceArmPaginatedResult model = - new OnlineDeploymentTrackedResourceArmPaginatedResult() - .withNextLink("rprsnm") - .withValue( - Arrays - .asList( - new OnlineDeploymentInner() - .withLocation("sqbuc") - .withTags( - mapOf("sdaultxij", "kyexaoguyaipi", "qwazlnqnmcjngzq", "um", "sf", "qxtbjwgnyf")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("lbkpb") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("aqtferr") - .withEnvironmentId("ex") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(false) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("jh") - .withModel("vechndbnwiehole") - .withModelMountPath("wiuub")) - .withSku( - new Sku() - .withName("xap") - .withTier(SkuTier.FREE) - .withSize("qqnobpudcd") - .withFamily("tqwpwya") - .withCapacity(2036163978)), - new OnlineDeploymentInner() - .withLocation("fdwfmvigorqj") - .withTags(mapOf("n", "zhraglkafh")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("qryxyn") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("sxwaabzm") - .withEnvironmentId("rygznmmaxriz") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(true) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.DISABLED) - .withInstanceType("sovwxznptgoeiyb") - .withModel("pfhvfslk") - .withModelMountPath("tjlrigjksky")) - .withSku( - new Sku() - .withName("gopxlhslnelxie") - .withTier(SkuTier.BASIC) - .withSize("llxecwc") - .withFamily("jphslhcaw") - .withCapacity(224494261)), - new OnlineDeploymentInner() - .withLocation("qnhcvsqltnzoibg") - .withTags(mapOf("qoxwd", "nxfyqonm")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("edexxmlfm") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("ywakoihk") - .withEnvironmentId("mjblmljhlny") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(true) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("uawxtzx") - .withModel("mwabzxrvxc") - .withModelMountPath("hsphaivmxyas")) - .withSku( - new Sku() - .withName("qyryuzcbmqqvxm") - .withTier(SkuTier.STANDARD) - .withSize("tayx") - .withFamily("supe") - .withCapacity(2074822274)), - new OnlineDeploymentInner() - .withLocation("bzbkiw") - .withTags( - mapOf( - "ophzfylsgcrp", "n", "fwyfwlwxjwet", "bcunezzceze", "zvaylptrsqqw", "psihcla")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("vwbcblembnkbwv") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("sazgakgacyrcmj") - .withEnvironmentId("spofapvuhry") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(false) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("vqihebwtswbzuwf") - .withModel("ragegi") - .withModelMountPath("cjfelisdjubgg")) - .withSku( - new Sku() - .withName("frzgbzjed") - .withTier(SkuTier.PREMIUM) - .withSize("vnlvxbcuiiznktwf") - .withFamily("snvpdibmi") - .withCapacity(1037622433)))); - model = BinaryData.fromObject(model).toObject(OnlineDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("rprsnm", model.nextLink()); - Assertions.assertEquals("sqbuc", model.value().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", model.value().get(0).tags().get("sdaultxij")); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lbkpb", model.value().get(0).kind()); - Assertions.assertEquals("aqtferr", model.value().get(0).properties().description()); - Assertions.assertEquals("ex", model.value().get(0).properties().environmentId()); - Assertions.assertEquals(false, model.value().get(0).properties().appInsightsEnabled()); - Assertions - .assertEquals( - EgressPublicNetworkAccessType.ENABLED, model.value().get(0).properties().egressPublicNetworkAccess()); - Assertions.assertEquals("jh", model.value().get(0).properties().instanceType()); - Assertions.assertEquals("vechndbnwiehole", model.value().get(0).properties().model()); - Assertions.assertEquals("wiuub", model.value().get(0).properties().modelMountPath()); - Assertions.assertEquals("xap", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("qqnobpudcd", model.value().get(0).sku().size()); - Assertions.assertEquals("tqwpwya", model.value().get(0).sku().family()); - Assertions.assertEquals(2036163978, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java deleted file mode 100644 index aba6309a97e8c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .onlineDeployments() - .delete("mbhdo", "m", "ngkqlgxzduvxd", "xexatmdmnrs", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java deleted file mode 100644 index 260040167db7f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogs; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsGetLogsWithResponseMockTests { - @Test - public void testGetLogsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"content\":\"exvtemasp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeploymentLogs response = - manager - .onlineDeployments() - .getLogsWithResponse( - "qtlfoz", - "umrtgjqg", - "cant", - "syxzxjmkanbc", - new DeploymentLogsRequest().withContainerType(ContainerType.INFERENCE_SERVER).withTail(129296832), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("exvtemasp", response.content()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java deleted file mode 100644 index 3ee3e1add3d89..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.SkuResource; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsListSkusMockTests { - @Test - public void testListSkus() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"capacity\":{\"default\":535751545,\"maximum\":1856017180,\"minimum\":1547287008,\"scaleType\":\"Automatic\"},\"resourceType\":\"iv\",\"sku\":{\"name\":\"jybsrwz\",\"tier\":\"Free\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .onlineDeployments() - .listSkus("anydsc", "k", "w", "pwjc", 1694569219, "aahntofelfh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(535751545, response.iterator().next().capacity().defaultProperty()); - Assertions.assertEquals(1856017180, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(1547287008, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, response.iterator().next().capacity().scaleType()); - Assertions.assertEquals("jybsrwz", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index b5c43b64a29e2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.OnlineEndpointInner; -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OnlineEndpointTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"hxgsrboldfor\",\"value\":[{\"identity\":{\"principalId\":\"1f6aefd4-b02f-4a33-a590-718f0cb48b50\",\"tenantId\":\"57f14320-4135-4edf-99b3-3048e39f355a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"fhfovv\",\"properties\":{\"compute\":\"qpbtuodxes\",\"provisioningState\":\"Creating\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"AADToken\",\"description\":\"umuaslzkwrrwoycq\",\"properties\":{},\"scoringUri\":\"hahnomdrkywuhps\",\"swaggerUri\":\"uurutlwexxwlalni\"},\"sku\":{\"name\":\"zsrzpgepq\",\"tier\":\"Free\",\"size\":\"wwpgdakchzyvlixq\",\"family\":\"kcxk\",\"capacity\":330254773},\"location\":\"xmysuxswqrntv\",\"tags\":{\"pwcyyufmhr\":\"jpsttexoq\",\"wmqs\":\"nc\"},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"},{\"identity\":{\"principalId\":\"a4151eb7-8663-4b97-8345-804b77541a0a\",\"tenantId\":\"7879de7c-a628-4534-a453-c05523e5b09d\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"cgegydcwbo\",\"properties\":{\"compute\":\"umvq\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"traffic\":{},\"authMode\":\"AMLToken\",\"description\":\"iouaubrjt\",\"properties\":{},\"scoringUri\":\"fuojrngif\",\"swaggerUri\":\"z\"},\"sku\":{\"name\":\"sccbiuimzd\",\"tier\":\"Premium\",\"size\":\"fqwmkyoquf\",\"family\":\"ruzslzoj\",\"capacity\":617076882},\"location\":\"fnmdxotn\",\"tags\":{\"i\":\"gugey\"},\"id\":\"grkyuizabsnmfpph\",\"name\":\"jee\",\"type\":\"yhyhsgzfczb\"},{\"identity\":{\"principalId\":\"ccf81f2a-7aba-4873-b90b-315fea316226\",\"tenantId\":\"eba5c18a-712b-44fe-9aa8-0765f707c485\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"glqgleoh\",\"properties\":{\"compute\":\"etnluankrrfx\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"Key\",\"description\":\"acvbmqz\",\"properties\":{},\"scoringUri\":\"lajrnwxacevehj\",\"swaggerUri\":\"yxoaf\"},\"sku\":{\"name\":\"oqltfae\",\"tier\":\"Standard\",\"size\":\"mfgvxirpghriypo\",\"family\":\"yhlqhykprlpyznu\",\"capacity\":184808617},\"location\":\"smexiitdf\",\"tags\":{\"nnust\":\"yasiibmiy\",\"nmgixh\":\"nlj\",\"oudorhcgyyp\":\"mavmq\",\"hu\":\"otwypundmb\"},\"id\":\"cmjkavlgorbmftpm\",\"name\":\"tzfjltf\",\"type\":\"nzcyjtotp\"}]}") - .toObject(OnlineEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("hxgsrboldfor", model.nextLink()); - Assertions.assertEquals("xmysuxswqrntv", model.value().get(0).location()); - Assertions.assertEquals("jpsttexoq", model.value().get(0).tags().get("pwcyyufmhr")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("fhfovv", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.AADTOKEN, model.value().get(0).properties().authMode()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.value().get(0).properties().description()); - Assertions.assertEquals("qpbtuodxes", model.value().get(0).properties().compute()); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("zsrzpgepq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("wwpgdakchzyvlixq", model.value().get(0).sku().size()); - Assertions.assertEquals("kcxk", model.value().get(0).sku().family()); - Assertions.assertEquals(330254773, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineEndpointTrackedResourceArmPaginatedResult model = - new OnlineEndpointTrackedResourceArmPaginatedResult() - .withNextLink("hxgsrboldfor") - .withValue( - Arrays - .asList( - new OnlineEndpointInner() - .withLocation("xmysuxswqrntv") - .withTags(mapOf("pwcyyufmhr", "jpsttexoq", "wmqs", "nc")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("fhfovv") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AADTOKEN) - .withDescription("umuaslzkwrrwoycq") - .withProperties(mapOf()) - .withCompute("qpbtuodxes") - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("zsrzpgepq") - .withTier(SkuTier.FREE) - .withSize("wwpgdakchzyvlixq") - .withFamily("kcxk") - .withCapacity(330254773)), - new OnlineEndpointInner() - .withLocation("fnmdxotn") - .withTags(mapOf("i", "gugey")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("cgegydcwbo") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("iouaubrjt") - .withProperties(mapOf()) - .withCompute("umvq") - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("sccbiuimzd") - .withTier(SkuTier.PREMIUM) - .withSize("fqwmkyoquf") - .withFamily("ruzslzoj") - .withCapacity(617076882)), - new OnlineEndpointInner() - .withLocation("smexiitdf") - .withTags( - mapOf( - "nnust", - "yasiibmiy", - "nmgixh", - "nlj", - "oudorhcgyyp", - "mavmq", - "hu", - "otwypundmb")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("glqgleoh") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.KEY) - .withDescription("acvbmqz") - .withProperties(mapOf()) - .withCompute("etnluankrrfx") - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("oqltfae") - .withTier(SkuTier.STANDARD) - .withSize("mfgvxirpghriypo") - .withFamily("yhlqhykprlpyznu") - .withCapacity(184808617)))); - model = BinaryData.fromObject(model).toObject(OnlineEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("hxgsrboldfor", model.nextLink()); - Assertions.assertEquals("xmysuxswqrntv", model.value().get(0).location()); - Assertions.assertEquals("jpsttexoq", model.value().get(0).tags().get("pwcyyufmhr")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("fhfovv", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.AADTOKEN, model.value().get(0).properties().authMode()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.value().get(0).properties().description()); - Assertions.assertEquals("qpbtuodxes", model.value().get(0).properties().compute()); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("zsrzpgepq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("wwpgdakchzyvlixq", model.value().get(0).sku().size()); - Assertions.assertEquals("kcxk", model.value().get(0).sku().family()); - Assertions.assertEquals(330254773, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java deleted file mode 100644 index ebc153d904fdb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineEndpointsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.onlineEndpoints().delete("cbnygd", "c", "xwbpwyykdig", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java deleted file mode 100644 index 29e7ab16920cd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class OnlineRequestSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineRequestSettings model = - BinaryData - .fromString( - "{\"maxConcurrentRequestsPerInstance\":1659306080,\"maxQueueWait\":\"PT185H26M24S\",\"requestTimeout\":\"PT152H42M33S\"}") - .toObject(OnlineRequestSettings.class); - Assertions.assertEquals(1659306080, model.maxConcurrentRequestsPerInstance()); - Assertions.assertEquals(Duration.parse("PT185H26M24S"), model.maxQueueWait()); - Assertions.assertEquals(Duration.parse("PT152H42M33S"), model.requestTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineRequestSettings model = - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1659306080) - .withMaxQueueWait(Duration.parse("PT185H26M24S")) - .withRequestTimeout(Duration.parse("PT152H42M33S")); - model = BinaryData.fromObject(model).toObject(OnlineRequestSettings.class); - Assertions.assertEquals(1659306080, model.maxConcurrentRequestsPerInstance()); - Assertions.assertEquals(Duration.parse("PT185H26M24S"), model.maxQueueWait()); - Assertions.assertEquals(Duration.parse("PT152H42M33S"), model.requestTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java deleted file mode 100644 index e77786ec9dac2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OnlineScaleSettings; - -public final class OnlineScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"OnlineScaleSettings\"}").toObject(OnlineScaleSettings.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineScaleSettings model = new OnlineScaleSettings(); - model = BinaryData.fromObject(model).toObject(OnlineScaleSettings.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java deleted file mode 100644 index 2e2d86093d611..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlOperation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"injdllwktlepo\",\"display\":{\"provider\":\"vqxuajgcqw\",\"resource\":\"ynkgfcfd\",\"operation\":\"wsikxxtclhuulr\",\"description\":\"byokvjgbzsxe\"},\"isDataAction\":false}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("injdllwktlepo", response.iterator().next().name()); - Assertions.assertEquals("vqxuajgcqw", response.iterator().next().display().provider()); - Assertions.assertEquals("ynkgfcfd", response.iterator().next().display().resource()); - Assertions.assertEquals("wsikxxtclhuulr", response.iterator().next().display().operation()); - Assertions.assertEquals("byokvjgbzsxe", response.iterator().next().display().description()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java deleted file mode 100644 index 693f796d85b9d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputPathAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class OutputPathAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutputPathAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"OutputPath\",\"jobId\":\"h\",\"path\":\"mexznlwkb\"}") - .toObject(OutputPathAssetReference.class); - Assertions.assertEquals("h", model.jobId()); - Assertions.assertEquals("mexznlwkb", model.path()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutputPathAssetReference model = new OutputPathAssetReference().withJobId("h").withPath("mexznlwkb"); - model = BinaryData.fromObject(model).toObject(OutputPathAssetReference.class); - Assertions.assertEquals("h", model.jobId()); - Assertions.assertEquals("mexznlwkb", model.path()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java deleted file mode 100644 index 547ba53df3c1d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PaginatedComputeResourcesList; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PaginatedComputeResourcesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PaginatedComputeResourcesList model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"6e82368f-483c-407c-b3d6-2d64ef6e71aa\",\"tenantId\":\"821c3424-4690-42c4-a22b-b51baca687f1\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"unmmq\",\"tags\":{\"ocukoklyax\":\"xzko\"},\"sku\":{\"name\":\"onuq\",\"tier\":\"Basic\",\"size\":\"beypewrmjmw\",\"family\":\"jektcxsenh\",\"capacity\":2036309182},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"rzpwvlqdqgbiq\",\"provisioningState\":\"Deleting\",\"description\":\"kaet\",\"createdOn\":\"2021-03-20T05:01:22Z\",\"modifiedOn\":\"2021-02-19T02:27:03Z\",\"resourceId\":\"ivfsnk\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false},\"id\":\"hjfbebrjcxe\",\"name\":\"fuwutttxf\",\"type\":\"jrbirphxepcyv\"}],\"nextLink\":\"fnljky\"}") - .toObject(PaginatedComputeResourcesList.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("unmmq", model.value().get(0).location()); - Assertions.assertEquals("xzko", model.value().get(0).tags().get("ocukoklyax")); - Assertions.assertEquals("onuq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("beypewrmjmw", model.value().get(0).sku().size()); - Assertions.assertEquals("jektcxsenh", model.value().get(0).sku().family()); - Assertions.assertEquals(2036309182, model.value().get(0).sku().capacity()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value().get(0).properties().computeLocation()); - Assertions.assertEquals("kaet", model.value().get(0).properties().description()); - Assertions.assertEquals("ivfsnk", model.value().get(0).properties().resourceId()); - Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); - Assertions.assertEquals("fnljky", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PaginatedComputeResourcesList model = - new PaginatedComputeResourcesList() - .withValue( - Arrays - .asList( - new ComputeResourceInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("unmmq") - .withTags(mapOf("ocukoklyax", "xzko")) - .withSku( - new Sku() - .withName("onuq") - .withTier(SkuTier.BASIC) - .withSize("beypewrmjmw") - .withFamily("jektcxsenh") - .withCapacity(2036309182)) - .withProperties( - new Compute() - .withComputeLocation("rzpwvlqdqgbiq") - .withDescription("kaet") - .withResourceId("ivfsnk") - .withDisableLocalAuth(false)))) - .withNextLink("fnljky"); - model = BinaryData.fromObject(model).toObject(PaginatedComputeResourcesList.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("unmmq", model.value().get(0).location()); - Assertions.assertEquals("xzko", model.value().get(0).tags().get("ocukoklyax")); - Assertions.assertEquals("onuq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("beypewrmjmw", model.value().get(0).sku().size()); - Assertions.assertEquals("jektcxsenh", model.value().get(0).sku().family()); - Assertions.assertEquals(2036309182, model.value().get(0).sku().capacity()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value().get(0).properties().computeLocation()); - Assertions.assertEquals("kaet", model.value().get(0).properties().description()); - Assertions.assertEquals("ivfsnk", model.value().get(0).properties().resourceId()); - Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); - Assertions.assertEquals("fnljky", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java deleted file mode 100644 index c4a98b0fb36c6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeployment; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"frvtpuqu\"},\"tags\":{\"doaon\":\"lgkfbt\",\"ed\":\"bjcntujitc\"}}") - .toObject(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.class); - Assertions.assertEquals("frvtpuqu", model.properties().description()); - Assertions.assertEquals("lgkfbt", model.tags().get("doaon")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties model = - new PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties() - .withProperties(new PartialBatchDeployment().withDescription("frvtpuqu")) - .withTags(mapOf("doaon", "lgkfbt", "ed", "bjcntujitc")); - model = - BinaryData - .fromObject(model) - .toObject(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.class); - Assertions.assertEquals("frvtpuqu", model.properties().description()); - Assertions.assertEquals("lgkfbt", model.tags().get("doaon")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java deleted file mode 100644 index bc27fbcb76184..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeployment; -import org.junit.jupiter.api.Assertions; - -public final class PartialBatchDeploymentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialBatchDeployment model = - BinaryData.fromString("{\"description\":\"wwa\"}").toObject(PartialBatchDeployment.class); - Assertions.assertEquals("wwa", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialBatchDeployment model = new PartialBatchDeployment().withDescription("wwa"); - model = BinaryData.fromObject(model).toObject(PartialBatchDeployment.class); - Assertions.assertEquals("wwa", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java deleted file mode 100644 index 939e861d2bb59..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialManagedServiceIdentity model = - BinaryData - .fromString("{\"type\":\"None\",\"userAssignedIdentities\":{\"dtmhrkwofyyvoqa\":\"dataibahwflus\"}}") - .toObject(PartialManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialManagedServiceIdentity model = - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("dtmhrkwofyyvoqa", "dataibahwflus")); - model = BinaryData.fromObject(model).toObject(PartialManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java deleted file mode 100644 index 7c2893c3737ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResource model = - BinaryData - .fromString("{\"tags\":{\"wbwo\":\"expbtg\",\"kcnqxwbpo\":\"nwashrtd\",\"aasipqi\":\"ulpiuj\"}}") - .toObject(PartialMinimalTrackedResource.class); - Assertions.assertEquals("expbtg", model.tags().get("wbwo")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResource model = - new PartialMinimalTrackedResource() - .withTags(mapOf("wbwo", "expbtg", "kcnqxwbpo", "nwashrtd", "aasipqi", "ulpiuj")); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResource.class); - Assertions.assertEquals("expbtg", model.tags().get("wbwo")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java deleted file mode 100644 index 6c42e362c03d4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceWithIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResourceWithIdentity model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"opkwhojv\":\"datamg\",\"mocmbqfqvmk\":\"dataajqgxy\",\"helxprglya\":\"dataxozap\"}},\"tags\":{\"uejrjxgc\":\"ckcb\",\"i\":\"qibrhosxsdqrhzoy\"}}") - .toObject(PartialMinimalTrackedResourceWithIdentity.class); - Assertions.assertEquals("ckcb", model.tags().get("uejrjxgc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResourceWithIdentity model = - new PartialMinimalTrackedResourceWithIdentity() - .withTags(mapOf("uejrjxgc", "ckcb", "i", "qibrhosxsdqrhzoy")) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("opkwhojv", "datamg", "mocmbqfqvmk", "dataajqgxy", "helxprglya", "dataxozap"))); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResourceWithIdentity.class); - Assertions.assertEquals("ckcb", model.tags().get("uejrjxgc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java deleted file mode 100644 index dfc67b508652f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSku; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceWithSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResourceWithSku model = - BinaryData - .fromString( - "{\"sku\":{\"capacity\":1978421071,\"family\":\"noamldsehaohdj\",\"name\":\"flzokxco\",\"size\":\"e\",\"tier\":\"Premium\"},\"tags\":{\"ftgz\":\"agltsxoa\"}}") - .toObject(PartialMinimalTrackedResourceWithSku.class); - Assertions.assertEquals("agltsxoa", model.tags().get("ftgz")); - Assertions.assertEquals(1978421071, model.sku().capacity()); - Assertions.assertEquals("noamldsehaohdj", model.sku().family()); - Assertions.assertEquals("flzokxco", model.sku().name()); - Assertions.assertEquals("e", model.sku().size()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResourceWithSku model = - new PartialMinimalTrackedResourceWithSku() - .withTags(mapOf("ftgz", "agltsxoa")) - .withSku( - new PartialSku() - .withCapacity(1978421071) - .withFamily("noamldsehaohdj") - .withName("flzokxco") - .withSize("e") - .withTier(SkuTier.PREMIUM)); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResourceWithSku.class); - Assertions.assertEquals("agltsxoa", model.tags().get("ftgz")); - Assertions.assertEquals(1978421071, model.sku().capacity()); - Assertions.assertEquals("noamldsehaohdj", model.sku().family()); - Assertions.assertEquals("flzokxco", model.sku().name()); - Assertions.assertEquals("e", model.sku().size()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java deleted file mode 100644 index 14f1c95632e06..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class PartialSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialSku model = - BinaryData - .fromString( - "{\"capacity\":1425632159,\"family\":\"swvefloccsrmoz\",\"name\":\"m\",\"size\":\"g\",\"tier\":\"Free\"}") - .toObject(PartialSku.class); - Assertions.assertEquals(1425632159, model.capacity()); - Assertions.assertEquals("swvefloccsrmoz", model.family()); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialSku model = - new PartialSku() - .withCapacity(1425632159) - .withFamily("swvefloccsrmoz") - .withName("m") - .withSize("g") - .withTier(SkuTier.FREE); - model = BinaryData.fromObject(model).toObject(PartialSku.class); - Assertions.assertEquals(1425632159, model.capacity()); - Assertions.assertEquals("swvefloccsrmoz", model.family()); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java deleted file mode 100644 index 71ac532ecdcb1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Password; - -public final class PasswordTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Password model = - BinaryData.fromString("{\"name\":\"pgvdf\",\"value\":\"otkftutqxlngx\"}").toObject(Password.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Password model = new Password(); - model = BinaryData.fromObject(model).toObject(Password.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java deleted file mode 100644 index ecc30fc061030..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssignedUser; -import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; -import org.junit.jupiter.api.Assertions; - -public final class PersonalComputeInstanceSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PersonalComputeInstanceSettings model = - BinaryData - .fromString("{\"assignedUser\":{\"objectId\":\"emc\",\"tenantId\":\"jk\"}}") - .toObject(PersonalComputeInstanceSettings.class); - Assertions.assertEquals("emc", model.assignedUser().objectId()); - Assertions.assertEquals("jk", model.assignedUser().tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PersonalComputeInstanceSettings model = - new PersonalComputeInstanceSettings() - .withAssignedUser(new AssignedUser().withObjectId("emc").withTenantId("jk")); - model = BinaryData.fromObject(model).toObject(PersonalComputeInstanceSettings.class); - Assertions.assertEquals("emc", model.assignedUser().objectId()); - Assertions.assertEquals("jk", model.assignedUser().tenantId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java deleted file mode 100644 index 9e4a3e6734b4c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobInput; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.PipelineJob; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PipelineJobTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PipelineJob model = - BinaryData - .fromString( - "{\"jobType\":\"Pipeline\",\"inputs\":{\"erufgjblcdrmy\":{\"jobInputType\":\"JobInput\",\"description\":\"khup\"},\"lugekdfqnhtt\":{\"jobInputType\":\"JobInput\",\"description\":\"emftzgyyky\"},\"kmhmnulwempdc\":{\"jobInputType\":\"JobInput\",\"description\":\"owrczfjjnnuxxr\"},\"sulwzpflusn\":{\"jobInputType\":\"JobInput\",\"description\":\"rhjul\"}},\"jobs\":{\"iyrgkoek\":\"datahhgzotf\"},\"outputs\":{\"pcqydeykvsk\":{\"jobOutputType\":\"JobOutput\",\"description\":\"xyxhighctxbxmo\"},\"boohxbms\":{\"jobOutputType\":\"JobOutput\",\"description\":\"zdfrjeizikgq\"},\"qaeo\":{\"jobOutputType\":\"JobOutput\",\"description\":\"cqsxrmdvewu\"}},\"settings\":\"datajh\",\"sourceJobId\":\"jkbvhhdaurgho\",\"componentId\":\"aexbkhxjxjo\",\"computeId\":\"lqxr\",\"displayName\":\"knkob\",\"experimentName\":\"tmbozomtzamicbig\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"sotirei\":{\"endpoint\":\"znuxkeuairaabmdl\",\"errorMessage\":\"bedpfixlhupmomih\",\"jobServiceType\":\"dnpxpkcdpr\",\"port\":656606105,\"properties\":{\"ghflrufssjyghsf\":\"yi\",\"fgvqcpdw\":\"rkbhammgmqfm\",\"dcdjhunh\":\"gquxweysland\"},\"status\":\"cgawnrrnquo\"}},\"status\":\"Finalizing\",\"description\":\"bfsx\",\"properties\":{\"mxcjzlquzexokjx\":\"yilbvz\"},\"tags\":{\"bwmvogljsvl\":\"vbzinz\",\"nwcehaqidoyzl\":\"gi\",\"pepiaeapfs\":\"giomqo\",\"pqqncju\":\"rgdtpeqnacyheqw\"}}") - .toObject(PipelineJob.class); - Assertions.assertEquals("bfsx", model.description()); - Assertions.assertEquals("yilbvz", model.properties().get("mxcjzlquzexokjx")); - Assertions.assertEquals("vbzinz", model.tags().get("bwmvogljsvl")); - Assertions.assertEquals("aexbkhxjxjo", model.componentId()); - Assertions.assertEquals("lqxr", model.computeId()); - Assertions.assertEquals("knkob", model.displayName()); - Assertions.assertEquals("tmbozomtzamicbig", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("znuxkeuairaabmdl", model.services().get("sotirei").endpoint()); - Assertions.assertEquals("dnpxpkcdpr", model.services().get("sotirei").jobServiceType()); - Assertions.assertEquals(656606105, model.services().get("sotirei").port()); - Assertions.assertEquals("yi", model.services().get("sotirei").properties().get("ghflrufssjyghsf")); - Assertions.assertEquals("khup", model.inputs().get("erufgjblcdrmy").description()); - Assertions.assertEquals("xyxhighctxbxmo", model.outputs().get("pcqydeykvsk").description()); - Assertions.assertEquals("jkbvhhdaurgho", model.sourceJobId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PipelineJob model = - new PipelineJob() - .withDescription("bfsx") - .withProperties(mapOf("mxcjzlquzexokjx", "yilbvz")) - .withTags( - mapOf( - "bwmvogljsvl", - "vbzinz", - "nwcehaqidoyzl", - "gi", - "pepiaeapfs", - "giomqo", - "pqqncju", - "rgdtpeqnacyheqw")) - .withComponentId("aexbkhxjxjo") - .withComputeId("lqxr") - .withDisplayName("knkob") - .withExperimentName("tmbozomtzamicbig") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "sotirei", - new JobService() - .withEndpoint("znuxkeuairaabmdl") - .withJobServiceType("dnpxpkcdpr") - .withPort(656606105) - .withProperties( - mapOf( - "ghflrufssjyghsf", "yi", "fgvqcpdw", "rkbhammgmqfm", "dcdjhunh", "gquxweysland")))) - .withInputs( - mapOf( - "erufgjblcdrmy", - new JobInput().withDescription("khup"), - "lugekdfqnhtt", - new JobInput().withDescription("emftzgyyky"), - "kmhmnulwempdc", - new JobInput().withDescription("owrczfjjnnuxxr"), - "sulwzpflusn", - new JobInput().withDescription("rhjul"))) - .withJobs(mapOf("iyrgkoek", "datahhgzotf")) - .withOutputs( - mapOf( - "pcqydeykvsk", - new JobOutput().withDescription("xyxhighctxbxmo"), - "boohxbms", - new JobOutput().withDescription("zdfrjeizikgq"), - "qaeo", - new JobOutput().withDescription("cqsxrmdvewu"))) - .withSettings("datajh") - .withSourceJobId("jkbvhhdaurgho"); - model = BinaryData.fromObject(model).toObject(PipelineJob.class); - Assertions.assertEquals("bfsx", model.description()); - Assertions.assertEquals("yilbvz", model.properties().get("mxcjzlquzexokjx")); - Assertions.assertEquals("vbzinz", model.tags().get("bwmvogljsvl")); - Assertions.assertEquals("aexbkhxjxjo", model.componentId()); - Assertions.assertEquals("lqxr", model.computeId()); - Assertions.assertEquals("knkob", model.displayName()); - Assertions.assertEquals("tmbozomtzamicbig", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("znuxkeuairaabmdl", model.services().get("sotirei").endpoint()); - Assertions.assertEquals("dnpxpkcdpr", model.services().get("sotirei").jobServiceType()); - Assertions.assertEquals(656606105, model.services().get("sotirei").port()); - Assertions.assertEquals("yi", model.services().get("sotirei").properties().get("ghflrufssjyghsf")); - Assertions.assertEquals("khup", model.inputs().get("erufgjblcdrmy").description()); - Assertions.assertEquals("xyxhighctxbxmo", model.outputs().get("pcqydeykvsk").description()); - Assertions.assertEquals("jkbvhhdaurgho", model.sourceJobId()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 6e4b39e897f0e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"pikxwczbyscnpqxu\",\"subnetArmId\":\"vyq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ybrk\",\"actionsRequired\":\"dumjgrtfwvuk\"},\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"ab4618d0-89cc-42a6-8af9-01fb81852cef\",\"tenantId\":\"33dab1a2-cc10-43fe-bcce-1e2e3342c542\",\"type\":\"None\",\"userAssignedIdentities\":{\"jcny\":{\"principalId\":\"73635982-b45d-422a-a162-47fa604aa819\",\"clientId\":\"cb770753-bd37-4dd1-b217-83ceefddad2d\"},\"kryhtnapczwlokj\":{\"principalId\":\"fb641d5f-adfd-43a0-bbd2-8d16389dbfff\",\"clientId\":\"f16c80f3-21be-4d6c-96a3-e663540b9fad\"},\"kkvnipjox\":{\"principalId\":\"15196c0f-16a1-4607-bd2c-7b17b17dcafa\",\"clientId\":\"3a992dc1-89b1-4e46-adcb-e1f376ec6fd6\"}}},\"location\":\"nchgej\",\"tags\":{\"ahuxinpm\":\"dmailzydehojw\",\"vcputegj\":\"njaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"sku\":{\"name\":\"djpslw\",\"tier\":\"Premium\",\"size\":\"vwryoqpso\",\"family\":\"ctazakljlahbcryf\",\"capacity\":1389039399},\"id\":\"osygex\",\"name\":\"aojakhmsbzjhcrz\",\"type\":\"vdphlxaolthqtr\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("nchgej", model.location()); - Assertions.assertEquals("dmailzydehojw", model.tags().get("ahuxinpm")); - Assertions.assertEquals("djpslw", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("vwryoqpso", model.sku().size()); - Assertions.assertEquals("ctazakljlahbcryf", model.sku().family()); - Assertions.assertEquals(1389039399, model.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ybrk", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dumjgrtfwvuk", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "jcny", - new UserAssignedIdentity(), - "kryhtnapczwlokj", - new UserAssignedIdentity(), - "kkvnipjox", - new UserAssignedIdentity()))) - .withLocation("nchgej") - .withTags( - mapOf( - "ahuxinpm", "dmailzydehojw", "vcputegj", "njaqwixjspro", "uuvmkjozkrwfnd", "wmfdatscmdvpjhul")) - .withSku( - new Sku() - .withName("djpslw") - .withTier(SkuTier.PREMIUM) - .withSize("vwryoqpso") - .withFamily("ctazakljlahbcryf") - .withCapacity(1389039399)) - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("ybrk") - .withActionsRequired("dumjgrtfwvuk")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("nchgej", model.location()); - Assertions.assertEquals("dmailzydehojw", model.tags().get("ahuxinpm")); - Assertions.assertEquals("djpslw", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("vwryoqpso", model.sku().size()); - Assertions.assertEquals("ctazakljlahbcryf", model.sku().family()); - Assertions.assertEquals(1389039399, model.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ybrk", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dumjgrtfwvuk", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 225154582dcf3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"a16b0819-56bd-4218-8f63-1a6e43318690\",\"tenantId\":\"e99cad70-8299-4702-98fd-698d21448ff7\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"k\",\"tags\":{\"kphywpnvjto\":\"dhbt\"},\"sku\":{\"name\":\"ermclfplphoxuscr\",\"tier\":\"Basic\",\"size\":\"ye\",\"family\":\"bjtazqugxywpmu\",\"capacity\":737814385},\"id\":\"zwfqkqujidsuyon\",\"name\":\"bglaocqxtccm\",\"type\":\"yudxytlmoy\"},{\"properties\":{\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"170fc112-1b20-4f58-819c-51041af9f532\",\"tenantId\":\"7ad71cc8-ee0b-4afa-8b0e-bab53c22c7f4\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"txhdzh\",\"tags\":{\"sbkyvpycanuzbp\":\"jbhckfrlhr\"},\"sku\":{\"name\":\"afkuwb\",\"tier\":\"Basic\",\"size\":\"bmehh\",\"family\":\"yvjusrtslhsp\",\"capacity\":1857421626},\"id\":\"maofmxagkv\",\"name\":\"melmqkrha\",\"type\":\"vljua\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"7ee1c31e-ec49-456e-8ea8-78f4129f7b6f\",\"tenantId\":\"0b889b39-707f-4b57-839f-013c448bcd09\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"alaexqpvfadmwsrc\",\"tags\":{\"zlfmisgwbnbbeld\":\"xpvgo\",\"ali\":\"wkz\"},\"sku\":{\"name\":\"rqhakauha\",\"tier\":\"Standard\",\"size\":\"wxosowzxcug\",\"family\":\"jooxdjebw\",\"capacity\":741000017},\"id\":\"wfvovbv\",\"name\":\"euecivyhzceuoj\",\"type\":\"jrwjueiotwm\"},{\"properties\":{\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"f58ea4b5-f02e-496b-a143-d4e796072a44\",\"tenantId\":\"ccb2ecc9-f620-4ad9-9e68-75414abeb40c\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"rjaw\",\"tags\":{\"fbkp\":\"gxhnisk\",\"lwn\":\"cg\"},\"sku\":{\"name\":\"hjdauwhvylwz\",\"tier\":\"Standard\",\"size\":\"xujznbmpowu\",\"family\":\"rzqlveu\",\"capacity\":1056372950},\"id\":\"j\",\"name\":\"khfxobbcswsrt\",\"type\":\"riplrbpbewtg\"}]}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("dhbt", model.value().get(0).tags().get("kphywpnvjto")); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("ye", model.value().get(0).sku().size()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).sku().family()); - Assertions.assertEquals(737814385, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("k") - .withTags(mapOf("kphywpnvjto", "dhbt")) - .withSku( - new Sku() - .withName("ermclfplphoxuscr") - .withTier(SkuTier.BASIC) - .withSize("ye") - .withFamily("bjtazqugxywpmu") - .withCapacity(737814385)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("txhdzh") - .withTags(mapOf("sbkyvpycanuzbp", "jbhckfrlhr")) - .withSku( - new Sku() - .withName("afkuwb") - .withTier(SkuTier.BASIC) - .withSize("bmehh") - .withFamily("yvjusrtslhsp") - .withCapacity(1857421626)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("alaexqpvfadmwsrc") - .withTags(mapOf("zlfmisgwbnbbeld", "xpvgo", "ali", "wkz")) - .withSku( - new Sku() - .withName("rqhakauha") - .withTier(SkuTier.STANDARD) - .withSize("wxosowzxcug") - .withFamily("jooxdjebw") - .withCapacity(741000017)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("rjaw") - .withTags(mapOf("fbkp", "gxhnisk", "lwn", "cg")) - .withSku( - new Sku() - .withName("hjdauwhvylwz") - .withTier(SkuTier.STANDARD) - .withSize("xujznbmpowu") - .withFamily("rzqlveu") - .withCapacity(1056372950)))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("dhbt", model.value().get(0).tags().get("kphywpnvjto")); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("ye", model.value().get(0).sku().size()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).sku().family()); - Assertions.assertEquals(737814385, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 2c41aa44579b6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"bpf\",\"subnetArmId\":\"s\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"v\",\"actionsRequired\":\"jrwzox\"},\"provisioningState\":\"Creating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jrwzox", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("v") - .withActionsRequired("jrwzox")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jrwzox", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6ce45394fe2b4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"k\",\"subnetArmId\":\"zkdtzxsoed\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"li\",\"actionsRequired\":\"zomucmqgisnionet\"},\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"6990e6f7-106a-433c-997d-a718208f7ce7\",\"tenantId\":\"38771c9c-5b53-4d64-924e-98d9bc7791cc\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"kgtlzl\",\"tags\":{\"zkbnbmxl\":\"lxcznn\",\"g\":\"mwt\",\"ahfsgb\":\"qzusitoq\"},\"sku\":{\"name\":\"lreesrfwsszvlcwl\",\"tier\":\"Basic\",\"size\":\"ntfxxcrqmipfjwfo\",\"family\":\"izmshxxba\",\"capacity\":1165412558},\"id\":\"ulnvgskj\",\"name\":\"o\",\"type\":\"jdzjsjzn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("dpwrp") - .withExistingWorkspace("ycpawm", "jp") - .withRegion("qp") - .withTags(mapOf("qgcnbhcbmjk", "zihqod", "n", "ti")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withSku( - new Sku() - .withName("ntsxjmfmeftvh") - .withTier(SkuTier.FREE) - .withSize("gjrhs") - .withFamily("w") - .withCapacity(2051010260)) - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("eyam") - .withActionsRequired("idmdiawpzxkzrntm")) - .create(); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("kgtlzl", response.location()); - Assertions.assertEquals("lxcznn", response.tags().get("zkbnbmxl")); - Assertions.assertEquals("lreesrfwsszvlcwl", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("ntfxxcrqmipfjwfo", response.sku().size()); - Assertions.assertEquals("izmshxxba", response.sku().family()); - Assertions.assertEquals(1165412558, response.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("li", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zomucmqgisnionet", response.privateLinkServiceConnectionState().actionsRequired()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java deleted file mode 100644 index 65d4a6a1878a5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .deleteWithResponse("yuqh", "lmcskyk", "fuofixcnpcfykkp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 92b171c50ec4d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"wzlzklasl\",\"subnetArmId\":\"ciz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"arwp\",\"actionsRequired\":\"saudoejtighsx\"},\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"77a4ccdb-fb26-4f04-884f-577353706d15\",\"tenantId\":\"82e5dd6c-ed00-424d-b9d3-56306a3b5e26\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"ahovuuw\",\"tags\":{\"jnhj\":\"e\",\"fbbcngkegxcypxbb\":\"oti\",\"qlf\":\"etwilyrzoxpd\"},\"sku\":{\"name\":\"lqownkiua\",\"tier\":\"Free\",\"size\":\"ahwkxjjm\",\"family\":\"nlmsoo\",\"capacity\":1046371938},\"id\":\"ecdh\",\"name\":\"yswcrptveajczx\",\"type\":\"lgsrgkrfizrpywlp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("bkbdhlltqstqkqs", "gxiynecovagzk", "eubanlxunpqcc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("ahovuuw", response.location()); - Assertions.assertEquals("e", response.tags().get("jnhj")); - Assertions.assertEquals("lqownkiua", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("ahwkxjjm", response.sku().size()); - Assertions.assertEquals("nlmsoo", response.sku().family()); - Assertions.assertEquals(1046371938, response.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("arwp", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("saudoejtighsx", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java deleted file mode 100644 index 499e64fc382e4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"m\",\"subnetArmId\":\"wrjlvzkl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"ikyjtkakvlb\",\"actionsRequired\":\"hjvpzaptu\"},\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"a1ace026-f3aa-406c-8a65-a498830c671a\",\"tenantId\":\"c3c04e1d-18fa-479e-90c4-b10480fc598c\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"wfgcdiykkcxwn\",\"tags\":{\"qohhihra\":\"qynvavitmdm\",\"rhlhpvzadbwenni\":\"quddrwjclj\",\"viqlluk\":\"afhxrzfrmvztiuc\"},\"sku\":{\"name\":\"rcqxgcbvzarmqc\",\"tier\":\"Premium\",\"size\":\"stsinvag\",\"family\":\"jyhdrxb\",\"capacity\":1587779031},\"id\":\"ehqwhitxnmxgn\",\"name\":\"guzbuw\",\"type\":\"orbalkj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().list("ti", "zkaugpucdocfqpl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("wfgcdiykkcxwn", response.iterator().next().location()); - Assertions.assertEquals("qynvavitmdm", response.iterator().next().tags().get("qohhihra")); - Assertions.assertEquals("rcqxgcbvzarmqc", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("stsinvag", response.iterator().next().sku().size()); - Assertions.assertEquals("jyhdrxb", response.iterator().next().sku().family()); - Assertions.assertEquals(1587779031, response.iterator().next().sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("ikyjtkakvlb", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "hjvpzaptu", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java deleted file mode 100644 index aa276bedb6103..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = - BinaryData.fromString("{\"id\":\"elluwfziton\",\"subnetArmId\":\"qfpjk\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java deleted file mode 100644 index 5ac2e05981140..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"c\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"7350756a-3e63-4658-9b36-a4c2e5f3a6d9\",\"tenantId\":\"02570bb2-e352-4d93-9bd1-d3451723dd5b\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"jkbegibtnmxiebww\",\"tags\":{\"tzjuzgwyzmhtxo\":\"ayqcgw\",\"nftguvriuhpr\":\"gmtsavjcbpwxqpsr\"},\"sku\":{\"name\":\"dyvxqtayriww\",\"tier\":\"Premium\",\"size\":\"bexrmcq\",\"family\":\"ycnojvknmefqsg\",\"capacity\":488274582},\"id\":\"apj\",\"name\":\"zhpvgqzcjrvxd\",\"type\":\"zlmwlxkvugfhz\"},{\"properties\":{\"groupId\":\"wjvzunluthnn\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"6cd9bb2d-0450-4976-a3e0-e2008cd6e042\",\"tenantId\":\"9dd771d6-e628-44bb-a9c6-f9185d3fbc61\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"pjzu\",\"tags\":{\"kzbbtd\":\"xdult\",\"bsjyofdx\":\"umveekgpwozuhkf\",\"oekqvk\":\"uusdttouwa\",\"vbxwyjsflhh\":\"lns\"},\"sku\":{\"name\":\"aln\",\"tier\":\"Premium\",\"size\":\"sxyawjoyaqcs\",\"family\":\"jpkiidzyexznelix\",\"capacity\":705550222},\"id\":\"tfolhbnx\",\"name\":\"nalaulppg\",\"type\":\"dtpnapnyiropuhp\"},{\"properties\":{\"groupId\":\"pgylg\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"87b8d495-467b-4407-881f-0443f65da17d\",\"tenantId\":\"79df8e42-2e01-42d2-92af-39e2c1627e59\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"v\",\"tags\":{\"rmgucnap\":\"ynqwwncwzzhxgk\",\"oellwp\":\"t\",\"qrhhu\":\"fdygpfqbuaceopz\"},\"sku\":{\"name\":\"pppcqeqxo\",\"tier\":\"Standard\",\"size\":\"hzxct\",\"family\":\"gbkdmoizpos\",\"capacity\":1176728044},\"id\":\"cfbu\",\"name\":\"rmfqjhhkxbpvj\",\"type\":\"mjh\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("jkbegibtnmxiebww", model.value().get(0).location()); - Assertions.assertEquals("ayqcgw", model.value().get(0).tags().get("tzjuzgwyzmhtxo")); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("bexrmcq", model.value().get(0).sku().size()); - Assertions.assertEquals("ycnojvknmefqsg", model.value().get(0).sku().family()); - Assertions.assertEquals(488274582, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model = - new PrivateLinkResourceListResultInner() - .withValue( - Arrays - .asList( - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("jkbegibtnmxiebww") - .withTags(mapOf("tzjuzgwyzmhtxo", "ayqcgw", "nftguvriuhpr", "gmtsavjcbpwxqpsr")) - .withSku( - new Sku() - .withName("dyvxqtayriww") - .withTier(SkuTier.PREMIUM) - .withSize("bexrmcq") - .withFamily("ycnojvknmefqsg") - .withCapacity(488274582)) - .withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("pjzu") - .withTags( - mapOf( - "kzbbtd", - "xdult", - "bsjyofdx", - "umveekgpwozuhkf", - "oekqvk", - "uusdttouwa", - "vbxwyjsflhh", - "lns")) - .withSku( - new Sku() - .withName("aln") - .withTier(SkuTier.PREMIUM) - .withSize("sxyawjoyaqcs") - .withFamily("jpkiidzyexznelix") - .withCapacity(705550222)) - .withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("v") - .withTags( - mapOf("rmgucnap", "ynqwwncwzzhxgk", "oellwp", "t", "qrhhu", "fdygpfqbuaceopz")) - .withSku( - new Sku() - .withName("pppcqeqxo") - .withTier(SkuTier.STANDARD) - .withSize("hzxct") - .withFamily("gbkdmoizpos") - .withCapacity(1176728044)) - .withRequiredZoneNames(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("jkbegibtnmxiebww", model.value().get(0).location()); - Assertions.assertEquals("ayqcgw", model.value().get(0).tags().get("tzjuzgwyzmhtxo")); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("bexrmcq", model.value().get(0).sku().size()); - Assertions.assertEquals("ycnojvknmefqsg", model.value().get(0).sku().family()); - Assertions.assertEquals(488274582, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 2a47ff8596969..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"ifthnz\",\"requiredMembers\":[\"sl\",\"nayqi\",\"ynduha\",\"hqlkthumaqo\"],\"requiredZoneNames\":[\"ycduier\",\"gccymvaolpssl\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ycduier", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("ycduier", "gccymvaolpssl")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ycduier", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java deleted file mode 100644 index b69f2148738bf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResource model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"yngudivk\",\"requiredMembers\":[\"wbxqzvszjfau\",\"j\"],\"requiredZoneNames\":[\"xivetvt\",\"qaqtdoqmcbxvwvxy\"]},\"identity\":{\"principalId\":\"5fc3592b-d219-44be-b65a-2e2b3de76d9f\",\"tenantId\":\"712bd8ad-1151-45f2-bf61-d3e7de7dee99\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"blytk\":{\"principalId\":\"a95d1cdd-f7ed-4f87-a472-8a4bf616620d\",\"clientId\":\"f6f8621d-afad-499a-badb-6ecb26a9f3bb\"},\"pe\":{\"principalId\":\"fca7d1ee-b91d-42ac-9117-8d0ab41ca837\",\"clientId\":\"02cc4e93-4a44-44b6-a4b9-9f73d769c0c8\"},\"fbkrvrnsvs\":{\"principalId\":\"6434654b-4b63-4930-a988-6c07d2c784db\",\"clientId\":\"52f29274-c586-42d1-b67f-e1d18d5fb113\"}}},\"location\":\"johxcrsb\",\"tags\":{\"wbhsqfsub\":\"asrru\",\"rxbpyb\":\"gjb\",\"twss\":\"rfbjf\"},\"sku\":{\"name\":\"ftpvjzbexil\",\"tier\":\"Basic\",\"size\":\"qqnvwpmq\",\"family\":\"ruoujmk\",\"capacity\":1426920839},\"id\":\"qytjrybnwjewgd\",\"name\":\"jervnaenqpehi\",\"type\":\"doy\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("johxcrsb", model.location()); - Assertions.assertEquals("asrru", model.tags().get("wbhsqfsub")); - Assertions.assertEquals("ftpvjzbexil", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("qqnvwpmq", model.sku().size()); - Assertions.assertEquals("ruoujmk", model.sku().family()); - Assertions.assertEquals(1426920839, model.sku().capacity()); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResource model = - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "blytk", - new UserAssignedIdentity(), - "pe", - new UserAssignedIdentity(), - "fbkrvrnsvs", - new UserAssignedIdentity()))) - .withLocation("johxcrsb") - .withTags(mapOf("wbhsqfsub", "asrru", "rxbpyb", "gjb", "twss", "rfbjf")) - .withSku( - new Sku() - .withName("ftpvjzbexil") - .withTier(SkuTier.BASIC) - .withSize("qqnvwpmq") - .withFamily("ruoujmk") - .withCapacity(1426920839)) - .withRequiredZoneNames(Arrays.asList("xivetvt", "qaqtdoqmcbxvwvxy")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("johxcrsb", model.location()); - Assertions.assertEquals("asrru", model.tags().get("wbhsqfsub")); - Assertions.assertEquals("ftpvjzbexil", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("qqnvwpmq", model.sku().size()); - Assertions.assertEquals("ruoujmk", model.sku().family()); - Assertions.assertEquals(1426920839, model.sku().capacity()); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java deleted file mode 100644 index 8cd519e982946..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResourceListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"c\",\"tags\":{\"m\":\"fshksnyzmspamwb\",\"qdktwtkvihlp\":\"nlslcef\",\"zhwv\":\"liwoyngu\"},\"id\":\"p\",\"name\":\"mhjhaus\",\"type\":\"b\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResourceListResult response = - manager - .privateLinkResources() - .listWithResponse("hxqqmqip", "y", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("c", response.value().get(0).location()); - Assertions.assertEquals("fshksnyzmspamwb", response.value().get(0).tags().get("m")); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 49d48777e4404..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString( - "{\"status\":\"Disconnected\",\"description\":\"fpdvhpfxxypi\",\"actionsRequired\":\"nmayhuybb\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, model.status()); - Assertions.assertEquals("fpdvhpfxxypi", model.description()); - Assertions.assertEquals("nmayhuybb", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.DISCONNECTED) - .withDescription("fpdvhpfxxypi") - .withActionsRequired("nmayhuybb"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, model.status()); - Assertions.assertEquals("fpdvhpfxxypi", model.description()); - Assertions.assertEquals("nmayhuybb", model.actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java deleted file mode 100644 index a2503cf5c9cbd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ProbeSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ProbeSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProbeSettings model = - BinaryData - .fromString( - "{\"failureThreshold\":1906628483,\"initialDelay\":\"PT113H32M27S\",\"period\":\"PT148H10M\",\"successThreshold\":619019093,\"timeout\":\"PT78H24M37S\"}") - .toObject(ProbeSettings.class); - Assertions.assertEquals(1906628483, model.failureThreshold()); - Assertions.assertEquals(Duration.parse("PT113H32M27S"), model.initialDelay()); - Assertions.assertEquals(Duration.parse("PT148H10M"), model.period()); - Assertions.assertEquals(619019093, model.successThreshold()); - Assertions.assertEquals(Duration.parse("PT78H24M37S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProbeSettings model = - new ProbeSettings() - .withFailureThreshold(1906628483) - .withInitialDelay(Duration.parse("PT113H32M27S")) - .withPeriod(Duration.parse("PT148H10M")) - .withSuccessThreshold(619019093) - .withTimeout(Duration.parse("PT78H24M37S")); - model = BinaryData.fromObject(model).toObject(ProbeSettings.class); - Assertions.assertEquals(1906628483, model.failureThreshold()); - Assertions.assertEquals(Duration.parse("PT113H32M27S"), model.initialDelay()); - Assertions.assertEquals(Duration.parse("PT148H10M"), model.period()); - Assertions.assertEquals(619019093, model.successThreshold()); - Assertions.assertEquals(Duration.parse("PT78H24M37S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java deleted file mode 100644 index 4400de400ecd2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PyTorch; -import org.junit.jupiter.api.Assertions; - -public final class PyTorchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PyTorch model = - BinaryData - .fromString("{\"distributionType\":\"PyTorch\",\"processCountPerInstance\":1314386445}") - .toObject(PyTorch.class); - Assertions.assertEquals(1314386445, model.processCountPerInstance()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PyTorch model = new PyTorch().withProcessCountPerInstance(1314386445); - model = BinaryData.fromObject(model).toObject(PyTorch.class); - Assertions.assertEquals(1314386445, model.processCountPerInstance()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java deleted file mode 100644 index a68e619c802bd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import org.junit.jupiter.api.Assertions; - -public final class QuotaBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaBaseProperties model = - BinaryData - .fromString( - "{\"id\":\"ozmyzydagfu\",\"type\":\"bezy\",\"limit\":1156651479695546396,\"unit\":\"Count\"}") - .toObject(QuotaBaseProperties.class); - Assertions.assertEquals("ozmyzydagfu", model.id()); - Assertions.assertEquals("bezy", model.type()); - Assertions.assertEquals(1156651479695546396L, model.limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaBaseProperties model = - new QuotaBaseProperties() - .withId("ozmyzydagfu") - .withType("bezy") - .withLimit(1156651479695546396L) - .withUnit(QuotaUnit.COUNT); - model = BinaryData.fromObject(model).toObject(QuotaBaseProperties.class); - Assertions.assertEquals("ozmyzydagfu", model.id()); - Assertions.assertEquals("bezy", model.type()); - Assertions.assertEquals(1156651479695546396L, model.limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.unit()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java deleted file mode 100644 index cdd5e013b5a5d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaUpdateParameters model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"oaeupfhyhltrpmo\",\"type\":\"mcmatuokthfuiu\",\"limit\":6209557393905029674,\"unit\":\"Count\"}],\"location\":\"kvxod\"}") - .toObject(QuotaUpdateParameters.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id()); - Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type()); - Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("kvxod", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaUpdateParameters model = - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId("oaeupfhyhltrpmo") - .withType("mcmatuokthfuiu") - .withLimit(6209557393905029674L) - .withUnit(QuotaUnit.COUNT))) - .withLocation("kvxod"); - model = BinaryData.fromObject(model).toObject(QuotaUpdateParameters.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id()); - Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type()); - Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("kvxod", model.location()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java deleted file mode 100644 index 64b726ec63d5f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ResourceQuota; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"txop\",\"amlWorkspaceLocation\":\"hpadkmdzg\",\"type\":\"zxvctkbbxuharls\",\"name\":{\"value\":\"ccla\",\"localizedValue\":\"oyn\"},\"limit\":3258721915949075156,\"unit\":\"Count\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.quotas().list("drhutfdo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java deleted file mode 100644 index 331408e61af21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotasResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ud\",\"type\":\"ckaprhknqiijge\",\"limit\":564973110703252614,\"unit\":\"Count\",\"status\":\"InvalidVMFamilyName\"},{\"id\":\"qih\",\"type\":\"yowltj\",\"limit\":818494289048822861,\"unit\":\"Count\",\"status\":\"OperationNotEnabledForRegion\"},{\"id\":\"ieproqksmfxm\",\"type\":\"prstvkitbfj\",\"limit\":2706549674295489273,\"unit\":\"Count\",\"status\":\"Success\"}],\"nextLink\":\"acqoccqrqxwetj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateWorkspaceQuotasResult response = - manager - .quotas() - .updateWithResponse( - "aaneakhtmhobcya", - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId("qtvkh") - .withType("oog") - .withLimit(8839691341349880163L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId("qymhcctopuow") - .withType("nskby") - .withLimit(4791092419176992520L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId("gx") - .withType("ajpxecxqnwhscoza") - .withLimit(5738000548376016022L) - .withUnit(QuotaUnit.COUNT))) - .withLocation("pknpwirfljfewxq"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java deleted file mode 100644 index fc93ee725ae10..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RandomSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.RandomSamplingAlgorithmRule; -import org.junit.jupiter.api.Assertions; - -public final class RandomSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RandomSamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"Random\",\"rule\":\"Random\",\"seed\":1677252615}") - .toObject(RandomSamplingAlgorithm.class); - Assertions.assertEquals(RandomSamplingAlgorithmRule.RANDOM, model.rule()); - Assertions.assertEquals(1677252615, model.seed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RandomSamplingAlgorithm model = - new RandomSamplingAlgorithm().withRule(RandomSamplingAlgorithmRule.RANDOM).withSeed(1677252615); - model = BinaryData.fromObject(model).toObject(RandomSamplingAlgorithm.class); - Assertions.assertEquals(RandomSamplingAlgorithmRule.RANDOM, model.rule()); - Assertions.assertEquals(1677252615, model.seed()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java deleted file mode 100644 index f20c15c87d6fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RecurrenceScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecurrenceSchedule model = - BinaryData - .fromString( - "{\"hours\":[2030386405,1910653936,488610875,1439896312],\"minutes\":[1083020573],\"monthDays\":[1541422170,1378797079,254990993],\"weekDays\":[\"Friday\",\"Saturday\",\"Saturday\"]}") - .toObject(RecurrenceSchedule.class); - Assertions.assertEquals(2030386405, model.hours().get(0)); - Assertions.assertEquals(1083020573, model.minutes().get(0)); - Assertions.assertEquals(1541422170, model.monthDays().get(0)); - Assertions.assertEquals(WeekDay.FRIDAY, model.weekDays().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecurrenceSchedule model = - new RecurrenceSchedule() - .withHours(Arrays.asList(2030386405, 1910653936, 488610875, 1439896312)) - .withMinutes(Arrays.asList(1083020573)) - .withMonthDays(Arrays.asList(1541422170, 1378797079, 254990993)) - .withWeekDays(Arrays.asList(WeekDay.FRIDAY, WeekDay.SATURDAY, WeekDay.SATURDAY)); - model = BinaryData.fromObject(model).toObject(RecurrenceSchedule.class); - Assertions.assertEquals(2030386405, model.hours().get(0)); - Assertions.assertEquals(1083020573, model.minutes().get(0)); - Assertions.assertEquals(1541422170, model.monthDays().get(0)); - Assertions.assertEquals(WeekDay.FRIDAY, model.weekDays().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java deleted file mode 100644 index f2509ff03af75..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RecurrenceTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecurrenceTrigger model = - BinaryData - .fromString( - "{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":712298972,\"schedule\":{\"hours\":[2143245313,620966114],\"minutes\":[41999694,2076319922],\"monthDays\":[2043297749,1561277343,1217879659,986610623],\"weekDays\":[\"Wednesday\",\"Monday\"]},\"endTime\":\"rlktgjcsggu\",\"startTime\":\"eml\",\"timeZone\":\"waeeczgfb\"}") - .toObject(RecurrenceTrigger.class); - Assertions.assertEquals("rlktgjcsggu", model.endTime()); - Assertions.assertEquals("eml", model.startTime()); - Assertions.assertEquals("waeeczgfb", model.timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.frequency()); - Assertions.assertEquals(712298972, model.interval()); - Assertions.assertEquals(2143245313, model.schedule().hours().get(0)); - Assertions.assertEquals(41999694, model.schedule().minutes().get(0)); - Assertions.assertEquals(2043297749, model.schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.WEDNESDAY, model.schedule().weekDays().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecurrenceTrigger model = - new RecurrenceTrigger() - .withEndTime("rlktgjcsggu") - .withStartTime("eml") - .withTimeZone("waeeczgfb") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(712298972) - .withSchedule( - new RecurrenceSchedule() - .withHours(Arrays.asList(2143245313, 620966114)) - .withMinutes(Arrays.asList(41999694, 2076319922)) - .withMonthDays(Arrays.asList(2043297749, 1561277343, 1217879659, 986610623)) - .withWeekDays(Arrays.asList(WeekDay.WEDNESDAY, WeekDay.MONDAY))); - model = BinaryData.fromObject(model).toObject(RecurrenceTrigger.class); - Assertions.assertEquals("rlktgjcsggu", model.endTime()); - Assertions.assertEquals("eml", model.startTime()); - Assertions.assertEquals("waeeczgfb", model.timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.frequency()); - Assertions.assertEquals(712298972, model.interval()); - Assertions.assertEquals(2143245313, model.schedule().hours().get(0)); - Assertions.assertEquals(41999694, model.schedule().minutes().get(0)); - Assertions.assertEquals(2043297749, model.schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.WEDNESDAY, model.schedule().weekDays().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java deleted file mode 100644 index 4151764643b30..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.Regression; -import com.azure.resourcemanager.machinelearning.models.RegressionModels; -import com.azure.resourcemanager.machinelearning.models.RegressionPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.RegressionTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RegressionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Regression model = - BinaryData - .fromString( - "{\"taskType\":\"Regression\",\"primaryMetric\":\"NormalizedRootMeanSquaredError\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"ElasticNet\"],\"blockedTrainingAlgorithms\":[\"ExtremeRandomTrees\",\"ElasticNet\"],\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT84H43M30S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datavsi\",\"stackMetaLearnerTrainPercentage\":29.842412252567886,\"stackMetaLearnerType\":\"LightGBMRegressor\"}},\"cvSplitColumnNames\":[\"zydisnuep\",\"wyj\",\"nldpxottd\"],\"featurizationSettings\":{\"blockedTransformers\":[\"CountVectorizer\",\"WoETargetEncoder\"],\"columnNameAndTypes\":{\"vcjwqwoqsratj\":\"zjihweebiphr\",\"jhfrzgdkkagv\":\"dhzybsp\"},\"enableDnnFeaturization\":true,\"mode\":\"Custom\",\"transformerParams\":{\"mo\":[]},\"datasetLanguage\":\"mzhwilzzhni\"},\"limitSettings\":{\"enableEarlyTermination\":true,\"exitScore\":3.9502204468192637,\"maxConcurrentTrials\":2133816848,\"maxCoresPerTrial\":444992966,\"maxTrials\":1238035913,\"timeout\":\"PT160H46M45S\",\"trialTimeout\":\"PT11H57M31S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"bkut\",\"description\":\"mltwjfluxynbpvzl\"},\"testDataSize\":9.59052197916832,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"njc\",\"description\":\"mocgjshg\"},\"validationDataSize\":1.3885888922809064,\"weightColumnName\":\"wvixq\",\"logVerbosity\":\"Error\",\"targetColumnName\":\"jkyb\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"clrvtzqnrbctbh\",\"description\":\"hxpcvrdnyeita\"}}") - .toObject(Regression.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("jkyb", model.targetColumnName()); - Assertions.assertEquals("hxpcvrdnyeita", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("clrvtzqnrbctbh", model.trainingData().uri()); - Assertions.assertEquals(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR, model.primaryMetric()); - Assertions.assertEquals(false, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(false, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT84H43M30S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 29.842412252567886D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals(RegressionModels.ELASTIC_NET, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals( - RegressionModels.EXTREME_RANDOM_TREES, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("zydisnuep", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mzhwilzzhni", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.COUNT_VECTORIZER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("zjihweebiphr", model.featurizationSettings().columnNameAndTypes().get("vcjwqwoqsratj")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.CUSTOM, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(3.9502204468192637D, model.limitSettings().exitScore()); - Assertions.assertEquals(2133816848, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(444992966, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(1238035913, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT160H46M45S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT11H57M31S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("mltwjfluxynbpvzl", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.testData().mode()); - Assertions.assertEquals("bkut", model.testData().uri()); - Assertions.assertEquals(9.59052197916832D, model.testDataSize()); - Assertions.assertEquals("mocgjshg", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("njc", model.validationData().uri()); - Assertions.assertEquals(1.3885888922809064D, model.validationDataSize()); - Assertions.assertEquals("wvixq", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Regression model = - new Regression() - .withLogVerbosity(LogVerbosity.ERROR) - .withTargetColumnName("jkyb") - .withTrainingData( - new MLTableJobInput() - .withDescription("hxpcvrdnyeita") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("clrvtzqnrbctbh")) - .withPrimaryMetric(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR) - .withTrainingSettings( - new RegressionTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT84H43M30S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datavsi") - .withStackMetaLearnerTrainPercentage(29.842412252567886D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms(Arrays.asList(RegressionModels.ELASTIC_NET)) - .withBlockedTrainingAlgorithms( - Arrays.asList(RegressionModels.EXTREME_RANDOM_TREES, RegressionModels.ELASTIC_NET))) - .withCvSplitColumnNames(Arrays.asList("zydisnuep", "wyj", "nldpxottd")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("mzhwilzzhni") - .withBlockedTransformers( - Arrays.asList(BlockedTransformers.COUNT_VECTORIZER, BlockedTransformers.WO_ETARGET_ENCODER)) - .withColumnNameAndTypes(mapOf("vcjwqwoqsratj", "zjihweebiphr", "jhfrzgdkkagv", "dhzybsp")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.CUSTOM) - .withTransformerParams(mapOf("mo", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(true) - .withExitScore(3.9502204468192637D) - .withMaxConcurrentTrials(2133816848) - .withMaxCoresPerTrial(444992966) - .withMaxTrials(1238035913) - .withTimeout(Duration.parse("PT160H46M45S")) - .withTrialTimeout(Duration.parse("PT11H57M31S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("mltwjfluxynbpvzl") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("bkut")) - .withTestDataSize(9.59052197916832D) - .withValidationData( - new MLTableJobInput() - .withDescription("mocgjshg") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("njc")) - .withValidationDataSize(1.3885888922809064D) - .withWeightColumnName("wvixq"); - model = BinaryData.fromObject(model).toObject(Regression.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("jkyb", model.targetColumnName()); - Assertions.assertEquals("hxpcvrdnyeita", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("clrvtzqnrbctbh", model.trainingData().uri()); - Assertions.assertEquals(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR, model.primaryMetric()); - Assertions.assertEquals(false, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(false, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT84H43M30S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 29.842412252567886D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals(RegressionModels.ELASTIC_NET, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals( - RegressionModels.EXTREME_RANDOM_TREES, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("zydisnuep", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mzhwilzzhni", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.COUNT_VECTORIZER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("zjihweebiphr", model.featurizationSettings().columnNameAndTypes().get("vcjwqwoqsratj")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.CUSTOM, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(3.9502204468192637D, model.limitSettings().exitScore()); - Assertions.assertEquals(2133816848, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(444992966, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(1238035913, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT160H46M45S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT11H57M31S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("mltwjfluxynbpvzl", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.testData().mode()); - Assertions.assertEquals("bkut", model.testData().uri()); - Assertions.assertEquals(9.59052197916832D, model.testDataSize()); - Assertions.assertEquals("mocgjshg", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("njc", model.validationData().uri()); - Assertions.assertEquals(1.3885888922809064D, model.validationDataSize()); - Assertions.assertEquals("wvixq", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java deleted file mode 100644 index 272e375c9c596..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RegressionModels; -import com.azure.resourcemanager.machinelearning.models.RegressionTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegressionTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegressionTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"LightGBM\"],\"blockedTrainingAlgorithms\":[\"DecisionTree\"],\"enableDnnTraining\":true,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":true,\"ensembleModelDownloadTimeout\":\"PT173H34M23S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datakiceevsaaxwsp\",\"stackMetaLearnerTrainPercentage\":33.77569584333657,\"stackMetaLearnerType\":\"LightGBMRegressor\"}}") - .toObject(RegressionTrainingSettings.class); - Assertions.assertEquals(true, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT173H34M23S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(33.77569584333657D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(RegressionModels.LIGHT_GBM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(RegressionModels.DECISION_TREE, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegressionTrainingSettings model = - new RegressionTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(true) - .withEnsembleModelDownloadTimeout(Duration.parse("PT173H34M23S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datakiceevsaaxwsp") - .withStackMetaLearnerTrainPercentage(33.77569584333657D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms(Arrays.asList(RegressionModels.LIGHT_GBM)) - .withBlockedTrainingAlgorithms(Arrays.asList(RegressionModels.DECISION_TREE)); - model = BinaryData.fromObject(model).toObject(RegressionTrainingSettings.class); - Assertions.assertEquals(true, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT173H34M23S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(33.77569584333657D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(RegressionModels.LIGHT_GBM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(RegressionModels.DECISION_TREE, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java deleted file mode 100644 index 8057b8532d54c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceBase model = - BinaryData - .fromString( - "{\"description\":\"ss\",\"properties\":{\"uyowqkdwy\":\"twbdsrezpdrhn\"},\"tags\":{\"rcgp\":\"ib\",\"ejzanlfz\":\"kpzi\",\"zonokixrjqci\":\"iavrm\"}}") - .toObject(ResourceBase.class); - Assertions.assertEquals("ss", model.description()); - Assertions.assertEquals("twbdsrezpdrhn", model.properties().get("uyowqkdwy")); - Assertions.assertEquals("ib", model.tags().get("rcgp")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceBase model = - new ResourceBase() - .withDescription("ss") - .withProperties(mapOf("uyowqkdwy", "twbdsrezpdrhn")) - .withTags(mapOf("rcgp", "ib", "ejzanlfz", "kpzi", "zonokixrjqci", "iavrm")); - model = BinaryData.fromObject(model).toObject(ResourceBase.class); - Assertions.assertEquals("ss", model.description()); - Assertions.assertEquals("twbdsrezpdrhn", model.properties().get("uyowqkdwy")); - Assertions.assertEquals("ib", model.tags().get("rcgp")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java deleted file mode 100644 index c0c0860a0d4e1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceConfiguration model = - BinaryData - .fromString( - "{\"instanceCount\":1364369199,\"instanceType\":\"kgjubgdknnqvsazn\",\"properties\":{\"mkycgra\":\"dataorudsgsa\"}}") - .toObject(ResourceConfiguration.class); - Assertions.assertEquals(1364369199, model.instanceCount()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.instanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceConfiguration model = - new ResourceConfiguration() - .withInstanceCount(1364369199) - .withInstanceType("kgjubgdknnqvsazn") - .withProperties(mapOf("mkycgra", "dataorudsgsa")); - model = BinaryData.fromObject(model).toObject(ResourceConfiguration.class); - Assertions.assertEquals(1364369199, model.instanceCount()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.instanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java deleted file mode 100644 index fbe206f907162..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceId; -import org.junit.jupiter.api.Assertions; - -public final class ResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceId model = BinaryData.fromString("{\"id\":\"gwgcl\"}").toObject(ResourceId.class); - Assertions.assertEquals("gwgcl", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceId model = new ResourceId().withId("gwgcl"); - model = BinaryData.fromObject(model).toObject(ResourceId.class); - Assertions.assertEquals("gwgcl", model.id()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java deleted file mode 100644 index 8a124e6a5b09d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceName; - -public final class ResourceNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceName model = - BinaryData - .fromString("{\"value\":\"yqzrnkcqvyxlw\",\"localizedValue\":\"lsicohoqqnwv\"}") - .toObject(ResourceName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceName model = new ResourceName(); - model = BinaryData.fromObject(model).toObject(ResourceName.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java deleted file mode 100644 index 55f5b24d6e2e6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner; - -public final class ResourceQuotaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceQuotaInner model = - BinaryData - .fromString( - "{\"id\":\"bkh\",\"amlWorkspaceLocation\":\"deyeamdphagalpbu\",\"type\":\"gipwhonowkg\",\"name\":{\"value\":\"ankixzbinjeput\",\"localizedValue\":\"rywn\"},\"limit\":4868014576917618697,\"unit\":\"Count\"}") - .toObject(ResourceQuotaInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceQuotaInner model = new ResourceQuotaInner(); - model = BinaryData.fromObject(model).toObject(ResourceQuotaInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java deleted file mode 100644 index 89d8b35868a43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Route; -import org.junit.jupiter.api.Assertions; - -public final class RouteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Route model = BinaryData.fromString("{\"path\":\"iykzkdncjdx\",\"port\":1933240221}").toObject(Route.class); - Assertions.assertEquals("iykzkdncjdx", model.path()); - Assertions.assertEquals(1933240221, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Route model = new Route().withPath("iykzkdncjdx").withPort(1933240221); - model = BinaryData.fromObject(model).toObject(Route.class); - Assertions.assertEquals("iykzkdncjdx", model.path()); - Assertions.assertEquals(1933240221, model.port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java deleted file mode 100644 index d126766fe08cb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithm; - -public final class SamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"SamplingAlgorithm\"}") - .toObject(SamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SamplingAlgorithm model = new SamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(SamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java deleted file mode 100644 index 3dfb52853552c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ScaleSettingsInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleSettingsInformation model = - BinaryData - .fromString( - "{\"scaleSettings\":{\"maxNodeCount\":2089644825,\"minNodeCount\":582953019,\"nodeIdleTimeBeforeScaleDown\":\"PT83H47M42S\"}}") - .toObject(ScaleSettingsInformation.class); - Assertions.assertEquals(2089644825, model.scaleSettings().maxNodeCount()); - Assertions.assertEquals(582953019, model.scaleSettings().minNodeCount()); - Assertions.assertEquals(Duration.parse("PT83H47M42S"), model.scaleSettings().nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleSettingsInformation model = - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(2089644825) - .withMinNodeCount(582953019) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT83H47M42S"))); - model = BinaryData.fromObject(model).toObject(ScaleSettingsInformation.class); - Assertions.assertEquals(2089644825, model.scaleSettings().maxNodeCount()); - Assertions.assertEquals(582953019, model.scaleSettings().minNodeCount()); - Assertions.assertEquals(Duration.parse("PT83H47M42S"), model.scaleSettings().nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java deleted file mode 100644 index dc8082b7e78f1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleSettings model = - BinaryData - .fromString( - "{\"maxNodeCount\":978941807,\"minNodeCount\":1532421493,\"nodeIdleTimeBeforeScaleDown\":\"PT119H2M26S\"}") - .toObject(ScaleSettings.class); - Assertions.assertEquals(978941807, model.maxNodeCount()); - Assertions.assertEquals(1532421493, model.minNodeCount()); - Assertions.assertEquals(Duration.parse("PT119H2M26S"), model.nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleSettings model = - new ScaleSettings() - .withMaxNodeCount(978941807) - .withMinNodeCount(1532421493) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT119H2M26S")); - model = BinaryData.fromObject(model).toObject(ScaleSettings.class); - Assertions.assertEquals(978941807, model.maxNodeCount()); - Assertions.assertEquals(1532421493, model.minNodeCount()); - Assertions.assertEquals(Duration.parse("PT119H2M26S"), model.nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java deleted file mode 100644 index 025be761cf92f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; - -public final class ScheduleActionBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleActionBase model = - BinaryData.fromString("{\"actionType\":\"ScheduleActionBase\"}").toObject(ScheduleActionBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleActionBase model = new ScheduleActionBase(); - model = BinaryData.fromObject(model).toObject(ScheduleActionBase.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java deleted file mode 100644 index 6b09e4895f95f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleBase model = - BinaryData - .fromString("{\"id\":\"piudeugfsxzecpa\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}") - .toObject(ScheduleBase.class); - Assertions.assertEquals("piudeugfsxzecpa", model.id()); - Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleBase model = - new ScheduleBase() - .withId("piudeugfsxzecpa") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(ScheduleBase.class); - Assertions.assertEquals("piudeugfsxzecpa", model.id()); - Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java deleted file mode 100644 index 9351a842ad4ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleInner model = - BinaryData - .fromString( - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"quvre\",\"isEnabled\":true,\"provisioningState\":\"Succeeded\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"vsujztczytqjtwh\",\"startTime\":\"unfprnjletlxs\",\"timeZone\":\"pddouifamowaziyn\"},\"description\":\"lqwzdvpiwhxqsz\",\"properties\":{\"m\":\"aajquhuxylrj\",\"kfkyjp\":\"ygjbmzyospspsh\",\"pssdfppyogtie\":\"sp\"},\"tags\":{\"munjdxvglnkvx\":\"tvczkcnyxr\",\"khpzvuqdflv\":\"xpaglqivbgkc\",\"xtiv\":\"niypfpubcpzg\",\"nidibgqjxg\":\"j\"}},\"id\":\"r\",\"name\":\"govfgpikqmhhaow\",\"type\":\"rmzvupo\"}") - .toObject(ScheduleInner.class); - Assertions.assertEquals("lqwzdvpiwhxqsz", model.properties().description()); - Assertions.assertEquals("aajquhuxylrj", model.properties().properties().get("m")); - Assertions.assertEquals("tvczkcnyxr", model.properties().tags().get("munjdxvglnkvx")); - Assertions.assertEquals("quvre", model.properties().displayName()); - Assertions.assertEquals(true, model.properties().isEnabled()); - Assertions.assertEquals("vsujztczytqjtwh", model.properties().trigger().endTime()); - Assertions.assertEquals("unfprnjletlxs", model.properties().trigger().startTime()); - Assertions.assertEquals("pddouifamowaziyn", model.properties().trigger().timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleInner model = - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("lqwzdvpiwhxqsz") - .withProperties(mapOf("m", "aajquhuxylrj", "kfkyjp", "ygjbmzyospspsh", "pssdfppyogtie", "sp")) - .withTags( - mapOf( - "munjdxvglnkvx", - "tvczkcnyxr", - "khpzvuqdflv", - "xpaglqivbgkc", - "xtiv", - "niypfpubcpzg", - "nidibgqjxg", - "j")) - .withAction(new ScheduleActionBase()) - .withDisplayName("quvre") - .withIsEnabled(true) - .withTrigger( - new TriggerBase() - .withEndTime("vsujztczytqjtwh") - .withStartTime("unfprnjletlxs") - .withTimeZone("pddouifamowaziyn"))); - model = BinaryData.fromObject(model).toObject(ScheduleInner.class); - Assertions.assertEquals("lqwzdvpiwhxqsz", model.properties().description()); - Assertions.assertEquals("aajquhuxylrj", model.properties().properties().get("m")); - Assertions.assertEquals("tvczkcnyxr", model.properties().tags().get("munjdxvglnkvx")); - Assertions.assertEquals("quvre", model.properties().displayName()); - Assertions.assertEquals(true, model.properties().isEnabled()); - Assertions.assertEquals("vsujztczytqjtwh", model.properties().trigger().endTime()); - Assertions.assertEquals("unfprnjletlxs", model.properties().trigger().startTime()); - Assertions.assertEquals("pddouifamowaziyn", model.properties().trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java deleted file mode 100644 index bba0061655f32..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchedulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleProperties model = - BinaryData - .fromString( - "{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"zdfuydzvkfvxcnqm\",\"isEnabled\":false,\"provisioningState\":\"Creating\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"kmvkhl\",\"startTime\":\"dhbemzqkzszu\",\"timeZone\":\"wtglxx\"},\"description\":\"jfpgpicrmn\",\"properties\":{\"vpqcb\":\"gmqgjs\",\"s\":\"rmbodt\"},\"tags\":{\"xousxauzl\":\"vriibakclacjfr\",\"wohqfzizvu\":\"vsg\",\"vmribiat\":\"mmkjsvthnwpztek\"}}") - .toObject(ScheduleProperties.class); - Assertions.assertEquals("jfpgpicrmn", model.description()); - Assertions.assertEquals("gmqgjs", model.properties().get("vpqcb")); - Assertions.assertEquals("vriibakclacjfr", model.tags().get("xousxauzl")); - Assertions.assertEquals("zdfuydzvkfvxcnqm", model.displayName()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("kmvkhl", model.trigger().endTime()); - Assertions.assertEquals("dhbemzqkzszu", model.trigger().startTime()); - Assertions.assertEquals("wtglxx", model.trigger().timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleProperties model = - new ScheduleProperties() - .withDescription("jfpgpicrmn") - .withProperties(mapOf("vpqcb", "gmqgjs", "s", "rmbodt")) - .withTags(mapOf("xousxauzl", "vriibakclacjfr", "wohqfzizvu", "vsg", "vmribiat", "mmkjsvthnwpztek")) - .withAction(new ScheduleActionBase()) - .withDisplayName("zdfuydzvkfvxcnqm") - .withIsEnabled(false) - .withTrigger( - new TriggerBase().withEndTime("kmvkhl").withStartTime("dhbemzqkzszu").withTimeZone("wtglxx")); - model = BinaryData.fromObject(model).toObject(ScheduleProperties.class); - Assertions.assertEquals("jfpgpicrmn", model.description()); - Assertions.assertEquals("gmqgjs", model.properties().get("vpqcb")); - Assertions.assertEquals("vriibakclacjfr", model.tags().get("xousxauzl")); - Assertions.assertEquals("zdfuydzvkfvxcnqm", model.displayName()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("kmvkhl", model.trigger().endTime()); - Assertions.assertEquals("dhbemzqkzszu", model.trigger().startTime()); - Assertions.assertEquals("wtglxx", model.trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java deleted file mode 100644 index 3c9894e04bbb2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.ScheduleResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"bmhyreeudz\",\"value\":[{\"properties\":{\"displayName\":\"pdqmjxlyyzglgouw\",\"isEnabled\":false,\"provisioningState\":\"Updating\",\"description\":\"uojqt\",\"properties\":{},\"tags\":{}},\"id\":\"kjeytunl\",\"name\":\"fjkwrusnkq\",\"type\":\"hsyrqunj\"},{\"properties\":{\"displayName\":\"denxau\",\"isEnabled\":true,\"provisioningState\":\"Creating\",\"description\":\"kifmjn\",\"properties\":{},\"tags\":{}},\"id\":\"qabpxuckpggqow\",\"name\":\"yirdhlisngwflqq\",\"type\":\"pizruwnpqxpxiw\"},{\"properties\":{\"displayName\":\"ngjsaasi\",\"isEnabled\":true,\"provisioningState\":\"Failed\",\"description\":\"jvkviirhgfgrws\",\"properties\":{},\"tags\":{}},\"id\":\"atzv\",\"name\":\"bglbyvict\",\"type\":\"tbrxkjz\"},{\"properties\":{\"displayName\":\"gxffmshkwf\",\"isEnabled\":false,\"provisioningState\":\"Creating\",\"description\":\"wopdbydpiz\",\"properties\":{},\"tags\":{}},\"id\":\"napxbiygnug\",\"name\":\"knfsmfcttuxuuyil\",\"type\":\"lq\"}]}") - .toObject(ScheduleResourceArmPaginatedResult.class); - Assertions.assertEquals("bmhyreeudz", model.nextLink()); - Assertions.assertEquals("uojqt", model.value().get(0).properties().description()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).properties().displayName()); - Assertions.assertEquals(false, model.value().get(0).properties().isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleResourceArmPaginatedResult model = - new ScheduleResourceArmPaginatedResult() - .withNextLink("bmhyreeudz") - .withValue( - Arrays - .asList( - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("uojqt") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("pdqmjxlyyzglgouw") - .withIsEnabled(false)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("kifmjn") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("denxau") - .withIsEnabled(true)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("jvkviirhgfgrws") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("ngjsaasi") - .withIsEnabled(true)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("wopdbydpiz") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("gxffmshkwf") - .withIsEnabled(false)))); - model = BinaryData.fromObject(model).toObject(ScheduleResourceArmPaginatedResult.class); - Assertions.assertEquals("bmhyreeudz", model.nextLink()); - Assertions.assertEquals("uojqt", model.value().get(0).properties().description()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).properties().displayName()); - Assertions.assertEquals(false, model.value().get(0).properties().isEnabled()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java deleted file mode 100644 index 4923d8a4a1d9b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"j\",\"isEnabled\":false,\"provisioningState\":\"Succeeded\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"nxqpwnikxkcajgrb\",\"startTime\":\"tsvgoocqs\",\"timeZone\":\"mzlpcx\"},\"description\":\"mhxxrqicfzfvwjd\",\"properties\":{\"dkjrzfwkyluobdx\":\"vpyeyoafinmpnqu\",\"p\":\"hqdcclcvqsr\"},\"tags\":{\"fxl\":\"cvwbz\",\"iywqnpfydrfbgcny\":\"ymfjxl\",\"styygjq\":\"byxmkhmqyncgaull\"}},\"id\":\"lmwqg\",\"name\":\"hmqmiwxzf\",\"type\":\"vzucqfgufjnb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = - manager - .schedules() - .define("xaravwwuasnjeglh") - .withExistingWorkspace("zyq", "brnxhjtlxfikj") - .withProperties( - new ScheduleProperties() - .withDescription("fhjxsawo") - .withProperties(mapOf("qkmwzrdqyoybmrno", "ffhx", "qphkv", "ocjnzdaiovrbhr")) - .withTags(mapOf("yp", "adcrxyl", "iwhjdfrwpsshrmn", "tyzvelffohu", "ogkscxj", "cclpct")) - .withAction(new ScheduleActionBase()) - .withDisplayName("xbozpcjcnwjz") - .withIsEnabled(false) - .withTrigger(new TriggerBase().withEndTime("nw").withStartTime("svoqiza").withTimeZone("sdso"))) - .create(); - - Assertions.assertEquals("mhxxrqicfzfvwjd", response.properties().description()); - Assertions.assertEquals("vpyeyoafinmpnqu", response.properties().properties().get("dkjrzfwkyluobdx")); - Assertions.assertEquals("cvwbz", response.properties().tags().get("fxl")); - Assertions.assertEquals("j", response.properties().displayName()); - Assertions.assertEquals(false, response.properties().isEnabled()); - Assertions.assertEquals("nxqpwnikxkcajgrb", response.properties().trigger().endTime()); - Assertions.assertEquals("tsvgoocqs", response.properties().trigger().startTime()); - Assertions.assertEquals("mzlpcx", response.properties().trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java deleted file mode 100644 index 830834e918e31..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.schedules().delete("yuveoxmpz", "wahdrdvhaztkxbi", "zfgxmbry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java deleted file mode 100644 index bd976d8ce7f14..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"qwdr\",\"isEnabled\":true,\"provisioningState\":\"Canceled\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"glmrcokzze\",\"startTime\":\"kounzsiy\",\"timeZone\":\"uby\"},\"description\":\"popikzeb\",\"properties\":{\"czygpmgfjcu\":\"fywtkqowsdlk\",\"otuzbybwjmtftc\":\"ojhhylxdevfiyy\"},\"tags\":{\"aqpibjg\":\"nirupkqnst\",\"bmsennqfabqcama\":\"vswmehfxrtt\"}},\"id\":\"ctcxs\",\"name\":\"mbzdxmsyn\",\"type\":\"kdnnyufxuzms\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = - manager.schedules().getWithResponse("mw", "bios", "qsykq", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("popikzeb", response.properties().description()); - Assertions.assertEquals("fywtkqowsdlk", response.properties().properties().get("czygpmgfjcu")); - Assertions.assertEquals("nirupkqnst", response.properties().tags().get("aqpibjg")); - Assertions.assertEquals("qwdr", response.properties().displayName()); - Assertions.assertEquals(true, response.properties().isEnabled()); - Assertions.assertEquals("glmrcokzze", response.properties().trigger().endTime()); - Assertions.assertEquals("kounzsiy", response.properties().trigger().startTime()); - Assertions.assertEquals("uby", response.properties().trigger().timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java deleted file mode 100644 index 4d28e762a5387..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import com.azure.resourcemanager.machinelearning.models.ScheduleListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"ygnbknhjgclxaxwc\",\"isEnabled\":false,\"provisioningState\":\"Failed\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"dzkucszghdoaqip\",\"startTime\":\"xclfrs\",\"timeZone\":\"rnmuvwvpuofddtbf\"},\"description\":\"kjcnginxdvmaoyq\",\"properties\":{\"txoqxtdn\":\"gyxzmxynofxl\"},\"tags\":{\"nivdqtkyk\":\"sjirkrpskcjhmmof\"}},\"id\":\"xnlsf\",\"name\":\"nyscaccpt\",\"type\":\"zetxygxxiceecvj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .schedules() - .list("jezbfsjwfczgl", "vbgukbs", "bw", ScheduleListViewType.ALL, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kjcnginxdvmaoyq", response.iterator().next().properties().description()); - Assertions.assertEquals("gyxzmxynofxl", response.iterator().next().properties().properties().get("txoqxtdn")); - Assertions.assertEquals("sjirkrpskcjhmmof", response.iterator().next().properties().tags().get("nivdqtkyk")); - Assertions.assertEquals("ygnbknhjgclxaxwc", response.iterator().next().properties().displayName()); - Assertions.assertEquals(false, response.iterator().next().properties().isEnabled()); - Assertions.assertEquals("dzkucszghdoaqip", response.iterator().next().properties().trigger().endTime()); - Assertions.assertEquals("xclfrs", response.iterator().next().properties().trigger().startTime()); - Assertions.assertEquals("rnmuvwvpuofddtbf", response.iterator().next().properties().trigger().timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java deleted file mode 100644 index 6146bafa97fcf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import org.junit.jupiter.api.Assertions; - -public final class ScriptReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptReference model = - BinaryData - .fromString( - "{\"scriptSource\":\"z\",\"scriptData\":\"blkujrllfojuidjp\",\"scriptArguments\":\"yjucejikzoeo\",\"timeout\":\"tzejetjklnt\"}") - .toObject(ScriptReference.class); - Assertions.assertEquals("z", model.scriptSource()); - Assertions.assertEquals("blkujrllfojuidjp", model.scriptData()); - Assertions.assertEquals("yjucejikzoeo", model.scriptArguments()); - Assertions.assertEquals("tzejetjklnt", model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptReference model = - new ScriptReference() - .withScriptSource("z") - .withScriptData("blkujrllfojuidjp") - .withScriptArguments("yjucejikzoeo") - .withTimeout("tzejetjklnt"); - model = BinaryData.fromObject(model).toObject(ScriptReference.class); - Assertions.assertEquals("z", model.scriptSource()); - Assertions.assertEquals("blkujrllfojuidjp", model.scriptData()); - Assertions.assertEquals("yjucejikzoeo", model.scriptArguments()); - Assertions.assertEquals("tzejetjklnt", model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java deleted file mode 100644 index 73a18add9a8a3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import org.junit.jupiter.api.Assertions; - -public final class ScriptsToExecuteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptsToExecute model = - BinaryData - .fromString( - "{\"startupScript\":{\"scriptSource\":\"rvkmjcwmjvlgfggc\",\"scriptData\":\"yylizrz\",\"scriptArguments\":\"psfxsf\",\"timeout\":\"tl\"},\"creationScript\":{\"scriptSource\":\"vagbwidqlvhukove\",\"scriptData\":\"i\",\"scriptArguments\":\"vjfn\",\"timeout\":\"mvl\"}}") - .toObject(ScriptsToExecute.class); - Assertions.assertEquals("rvkmjcwmjvlgfggc", model.startupScript().scriptSource()); - Assertions.assertEquals("yylizrz", model.startupScript().scriptData()); - Assertions.assertEquals("psfxsf", model.startupScript().scriptArguments()); - Assertions.assertEquals("tl", model.startupScript().timeout()); - Assertions.assertEquals("vagbwidqlvhukove", model.creationScript().scriptSource()); - Assertions.assertEquals("i", model.creationScript().scriptData()); - Assertions.assertEquals("vjfn", model.creationScript().scriptArguments()); - Assertions.assertEquals("mvl", model.creationScript().timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptsToExecute model = - new ScriptsToExecute() - .withStartupScript( - new ScriptReference() - .withScriptSource("rvkmjcwmjvlgfggc") - .withScriptData("yylizrz") - .withScriptArguments("psfxsf") - .withTimeout("tl")) - .withCreationScript( - new ScriptReference() - .withScriptSource("vagbwidqlvhukove") - .withScriptData("i") - .withScriptArguments("vjfn") - .withTimeout("mvl")); - model = BinaryData.fromObject(model).toObject(ScriptsToExecute.class); - Assertions.assertEquals("rvkmjcwmjvlgfggc", model.startupScript().scriptSource()); - Assertions.assertEquals("yylizrz", model.startupScript().scriptData()); - Assertions.assertEquals("psfxsf", model.startupScript().scriptArguments()); - Assertions.assertEquals("tl", model.startupScript().timeout()); - Assertions.assertEquals("vagbwidqlvhukove", model.creationScript().scriptSource()); - Assertions.assertEquals("i", model.creationScript().scriptData()); - Assertions.assertEquals("vjfn", model.creationScript().scriptArguments()); - Assertions.assertEquals("mvl", model.creationScript().timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java deleted file mode 100644 index 93d8e50a1bf87..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Seasonality; - -public final class SeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Seasonality model = BinaryData.fromString("{\"mode\":\"Seasonality\"}").toObject(Seasonality.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Seasonality model = new Seasonality(); - model = BinaryData.fromObject(model).toObject(Seasonality.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java deleted file mode 100644 index a89f03acf4af5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import org.junit.jupiter.api.Assertions; - -public final class ServiceManagedResourcesSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceManagedResourcesSettings model = - BinaryData - .fromString("{\"cosmosDb\":{\"collectionsThroughput\":775754231}}") - .toObject(ServiceManagedResourcesSettings.class); - Assertions.assertEquals(775754231, model.cosmosDb().collectionsThroughput()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceManagedResourcesSettings model = - new ServiceManagedResourcesSettings() - .withCosmosDb(new CosmosDbSettings().withCollectionsThroughput(775754231)); - model = BinaryData.fromObject(model).toObject(ServiceManagedResourcesSettings.class); - Assertions.assertEquals(775754231, model.cosmosDb().collectionsThroughput()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java deleted file mode 100644 index 1cf13f62bed67..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import com.azure.resourcemanager.machinelearning.models.SetupScripts; -import org.junit.jupiter.api.Assertions; - -public final class SetupScriptsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SetupScripts model = - BinaryData - .fromString( - "{\"scripts\":{\"startupScript\":{\"scriptSource\":\"otjewlpxuzzjgnre\",\"scriptData\":\"yhqotoihiqakydi\",\"scriptArguments\":\"brkwpzdqt\",\"timeout\":\"cspodaqax\"},\"creationScript\":{\"scriptSource\":\"ietgbebjfu\",\"scriptData\":\"moichdlpnfpubntn\",\"scriptArguments\":\"tzviqsowsaaelcat\",\"timeout\":\"ju\"}}}") - .toObject(SetupScripts.class); - Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource()); - Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData()); - Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments()); - Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout()); - Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource()); - Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData()); - Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments()); - Assertions.assertEquals("ju", model.scripts().creationScript().timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SetupScripts model = - new SetupScripts() - .withScripts( - new ScriptsToExecute() - .withStartupScript( - new ScriptReference() - .withScriptSource("otjewlpxuzzjgnre") - .withScriptData("yhqotoihiqakydi") - .withScriptArguments("brkwpzdqt") - .withTimeout("cspodaqax")) - .withCreationScript( - new ScriptReference() - .withScriptSource("ietgbebjfu") - .withScriptData("moichdlpnfpubntn") - .withScriptArguments("tzviqsowsaaelcat") - .withTimeout("ju"))); - model = BinaryData.fromObject(model).toObject(SetupScripts.class); - Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource()); - Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData()); - Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments()); - Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout()); - Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource()); - Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData()); - Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments()); - Assertions.assertEquals("ju", model.scripts().creationScript().timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java deleted file mode 100644 index 42cf41eef25f4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SharedPrivateLinkResourceProperty; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class SharedPrivateLinkResourcePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedPrivateLinkResourceProperty model = - BinaryData - .fromString( - "{\"privateLinkResourceId\":\"s\",\"groupId\":\"smjqulngsntnbyb\",\"requestMessage\":\"gc\",\"status\":\"Approved\"}") - .toObject(SharedPrivateLinkResourceProperty.class); - Assertions.assertEquals("s", model.privateLinkResourceId()); - Assertions.assertEquals("smjqulngsntnbyb", model.groupId()); - Assertions.assertEquals("gc", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedPrivateLinkResourceProperty model = - new SharedPrivateLinkResourceProperty() - .withPrivateLinkResourceId("s") - .withGroupId("smjqulngsntnbyb") - .withRequestMessage("gc") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED); - model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceProperty.class); - Assertions.assertEquals("s", model.privateLinkResourceId()); - Assertions.assertEquals("smjqulngsntnbyb", model.groupId()); - Assertions.assertEquals("gc", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java deleted file mode 100644 index 30813b7dfc771..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; -import org.junit.jupiter.api.Assertions; - -public final class SharedPrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedPrivateLinkResource model = - BinaryData - .fromString( - "{\"name\":\"bwjzr\",\"properties\":{\"privateLinkResourceId\":\"gxg\",\"groupId\":\"pemvtzfkufubljof\",\"requestMessage\":\"eofjaeqjh\",\"status\":\"Pending\"}}") - .toObject(SharedPrivateLinkResource.class); - Assertions.assertEquals("bwjzr", model.name()); - Assertions.assertEquals("gxg", model.privateLinkResourceId()); - Assertions.assertEquals("pemvtzfkufubljof", model.groupId()); - Assertions.assertEquals("eofjaeqjh", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedPrivateLinkResource model = - new SharedPrivateLinkResource() - .withName("bwjzr") - .withPrivateLinkResourceId("gxg") - .withGroupId("pemvtzfkufubljof") - .withRequestMessage("eofjaeqjh") - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING); - model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResource.class); - Assertions.assertEquals("bwjzr", model.name()); - Assertions.assertEquals("gxg", model.privateLinkResourceId()); - Assertions.assertEquals("pemvtzfkufubljof", model.groupId()); - Assertions.assertEquals("eofjaeqjh", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java deleted file mode 100644 index 28a064043258c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import org.junit.jupiter.api.Assertions; - -public final class SkuCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapacity model = - BinaryData - .fromString( - "{\"default\":179999920,\"maximum\":2087309055,\"minimum\":498585791,\"scaleType\":\"Automatic\"}") - .toObject(SkuCapacity.class); - Assertions.assertEquals(179999920, model.defaultProperty()); - Assertions.assertEquals(2087309055, model.maximum()); - Assertions.assertEquals(498585791, model.minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, model.scaleType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapacity model = - new SkuCapacity() - .withDefaultProperty(179999920) - .withMaximum(2087309055) - .withMinimum(498585791) - .withScaleType(SkuScaleType.AUTOMATIC); - model = BinaryData.fromObject(model).toObject(SkuCapacity.class); - Assertions.assertEquals(179999920, model.defaultProperty()); - Assertions.assertEquals(2087309055, model.maximum()); - Assertions.assertEquals(498585791, model.minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, model.scaleType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java deleted file mode 100644 index 66d1afb25b4f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"rmcaykgg\",\"value\":[{\"capacity\":{\"default\":167940342,\"maximum\":1720310055,\"minimum\":150393165,\"scaleType\":\"Manual\"},\"resourceType\":\"d\",\"sku\":{\"name\":\"pfnznthjtwkj\",\"tier\":\"Standard\"}}]}") - .toObject(SkuResourceArmPaginatedResult.class); - Assertions.assertEquals("rmcaykgg", model.nextLink()); - Assertions.assertEquals(167940342, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(1720310055, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(150393165, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("pfnznthjtwkj", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceArmPaginatedResult model = - new SkuResourceArmPaginatedResult() - .withNextLink("rmcaykgg") - .withValue( - Arrays - .asList( - new SkuResourceInner() - .withCapacity( - new SkuCapacity() - .withDefaultProperty(167940342) - .withMaximum(1720310055) - .withMinimum(150393165) - .withScaleType(SkuScaleType.MANUAL)) - .withSku(new SkuSetting().withName("pfnznthjtwkj").withTier(SkuTier.STANDARD)))); - model = BinaryData.fromObject(model).toObject(SkuResourceArmPaginatedResult.class); - Assertions.assertEquals("rmcaykgg", model.nextLink()); - Assertions.assertEquals(167940342, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(1720310055, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(150393165, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("pfnznthjtwkj", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java deleted file mode 100644 index c49c4c71bae58..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuResourceInner model = - BinaryData - .fromString( - "{\"capacity\":{\"default\":1475743122,\"maximum\":1335142199,\"minimum\":1634012333,\"scaleType\":\"Manual\"},\"resourceType\":\"cqiosmgbza\",\"sku\":{\"name\":\"xqdlyrtltlapr\",\"tier\":\"Basic\"}}") - .toObject(SkuResourceInner.class); - Assertions.assertEquals(1475743122, model.capacity().defaultProperty()); - Assertions.assertEquals(1335142199, model.capacity().maximum()); - Assertions.assertEquals(1634012333, model.capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals("xqdlyrtltlapr", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceInner model = - new SkuResourceInner() - .withCapacity( - new SkuCapacity() - .withDefaultProperty(1475743122) - .withMaximum(1335142199) - .withMinimum(1634012333) - .withScaleType(SkuScaleType.MANUAL)) - .withSku(new SkuSetting().withName("xqdlyrtltlapr").withTier(SkuTier.BASIC)); - model = BinaryData.fromObject(model).toObject(SkuResourceInner.class); - Assertions.assertEquals(1475743122, model.capacity().defaultProperty()); - Assertions.assertEquals(1335142199, model.capacity().maximum()); - Assertions.assertEquals(1634012333, model.capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals("xqdlyrtltlapr", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java deleted file mode 100644 index 069d89339005d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuSettingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuSetting model = - BinaryData.fromString("{\"name\":\"nnbsoqeqa\",\"tier\":\"Premium\"}").toObject(SkuSetting.class); - Assertions.assertEquals("nnbsoqeqa", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuSetting model = new SkuSetting().withName("nnbsoqeqa").withTier(SkuTier.PREMIUM); - model = BinaryData.fromObject(model).toObject(SkuSetting.class); - Assertions.assertEquals("nnbsoqeqa", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java deleted file mode 100644 index 5f25125dfac70..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = - BinaryData - .fromString( - "{\"name\":\"narxzxtheotus\",\"tier\":\"Free\",\"size\":\"v\",\"family\":\"iqihn\",\"capacity\":1574404612}") - .toObject(Sku.class); - Assertions.assertEquals("narxzxtheotus", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals("iqihn", model.family()); - Assertions.assertEquals(1574404612, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = - new Sku() - .withName("narxzxtheotus") - .withTier(SkuTier.FREE) - .withSize("v") - .withFamily("iqihn") - .withCapacity(1574404612); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("narxzxtheotus", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals("iqihn", model.family()); - Assertions.assertEquals(1574404612, model.capacity()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java deleted file mode 100644 index 3a87f545b8ce1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import org.junit.jupiter.api.Assertions; - -public final class StackEnsembleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StackEnsembleSettings model = - BinaryData - .fromString( - "{\"stackMetaLearnerKWargs\":\"datandlqvtwknvgmmbu\",\"stackMetaLearnerTrainPercentage\":7.642157888085865,\"stackMetaLearnerType\":\"LogisticRegression\"}") - .toObject(StackEnsembleSettings.class); - Assertions.assertEquals(7.642157888085865D, model.stackMetaLearnerTrainPercentage()); - Assertions.assertEquals(StackMetaLearnerType.LOGISTIC_REGRESSION, model.stackMetaLearnerType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StackEnsembleSettings model = - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datandlqvtwknvgmmbu") - .withStackMetaLearnerTrainPercentage(7.642157888085865D) - .withStackMetaLearnerType(StackMetaLearnerType.LOGISTIC_REGRESSION); - model = BinaryData.fromObject(model).toObject(StackEnsembleSettings.class); - Assertions.assertEquals(7.642157888085865D, model.stackMetaLearnerTrainPercentage()); - Assertions.assertEquals(StackMetaLearnerType.LOGISTIC_REGRESSION, model.stackMetaLearnerType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java deleted file mode 100644 index b1cd5557ce140..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class SweepJobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SweepJobLimits model = - BinaryData - .fromString( - "{\"jobLimitsType\":\"Sweep\",\"maxConcurrentTrials\":1289892692,\"maxTotalTrials\":1229317362,\"trialTimeout\":\"PT17H24M34S\",\"timeout\":\"PT94H24M1S\"}") - .toObject(SweepJobLimits.class); - Assertions.assertEquals(Duration.parse("PT94H24M1S"), model.timeout()); - Assertions.assertEquals(1289892692, model.maxConcurrentTrials()); - Assertions.assertEquals(1229317362, model.maxTotalTrials()); - Assertions.assertEquals(Duration.parse("PT17H24M34S"), model.trialTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SweepJobLimits model = - new SweepJobLimits() - .withTimeout(Duration.parse("PT94H24M1S")) - .withMaxConcurrentTrials(1289892692) - .withMaxTotalTrials(1229317362) - .withTrialTimeout(Duration.parse("PT17H24M34S")); - model = BinaryData.fromObject(model).toObject(SweepJobLimits.class); - Assertions.assertEquals(Duration.parse("PT94H24M1S"), model.timeout()); - Assertions.assertEquals(1289892692, model.maxConcurrentTrials()); - Assertions.assertEquals(1229317362, model.maxTotalTrials()); - Assertions.assertEquals(Duration.parse("PT17H24M34S"), model.trialTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java deleted file mode 100644 index ac5066baa849e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties; -import org.junit.jupiter.api.Assertions; - -public final class SynapseSparkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SynapseSparkProperties model = - BinaryData - .fromString( - "{\"autoScaleProperties\":{\"minNodeCount\":1954145446,\"enabled\":true,\"maxNodeCount\":1674537674},\"autoPauseProperties\":{\"delayInMinutes\":1052407004,\"enabled\":true},\"sparkVersion\":\"ojpslsvjgpliufi\",\"nodeCount\":1125182676,\"nodeSize\":\"xqvapcohh\",\"nodeSizeFamily\":\"cqpqojxcxzrzdc\",\"subscriptionId\":\"zbenribc\",\"resourceGroup\":\"etzqd\",\"workspaceName\":\"jwfljhznamtua\",\"poolName\":\"zwcjjncqtj\"}") - .toObject(SynapseSparkProperties.class); - Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount()); - Assertions.assertEquals(true, model.autoScaleProperties().enabled()); - Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.autoPauseProperties().enabled()); - Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion()); - Assertions.assertEquals(1125182676, model.nodeCount()); - Assertions.assertEquals("xqvapcohh", model.nodeSize()); - Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily()); - Assertions.assertEquals("zbenribc", model.subscriptionId()); - Assertions.assertEquals("etzqd", model.resourceGroup()); - Assertions.assertEquals("jwfljhznamtua", model.workspaceName()); - Assertions.assertEquals("zwcjjncqtj", model.poolName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SynapseSparkProperties model = - new SynapseSparkProperties() - .withAutoScaleProperties( - new AutoScaleProperties() - .withMinNodeCount(1954145446) - .withEnabled(true) - .withMaxNodeCount(1674537674)) - .withAutoPauseProperties(new AutoPauseProperties().withDelayInMinutes(1052407004).withEnabled(true)) - .withSparkVersion("ojpslsvjgpliufi") - .withNodeCount(1125182676) - .withNodeSize("xqvapcohh") - .withNodeSizeFamily("cqpqojxcxzrzdc") - .withSubscriptionId("zbenribc") - .withResourceGroup("etzqd") - .withWorkspaceName("jwfljhznamtua") - .withPoolName("zwcjjncqtj"); - model = BinaryData.fromObject(model).toObject(SynapseSparkProperties.class); - Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount()); - Assertions.assertEquals(true, model.autoScaleProperties().enabled()); - Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.autoPauseProperties().enabled()); - Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion()); - Assertions.assertEquals(1125182676, model.nodeCount()); - Assertions.assertEquals("xqvapcohh", model.nodeSize()); - Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily()); - Assertions.assertEquals("zbenribc", model.subscriptionId()); - Assertions.assertEquals("etzqd", model.resourceGroup()); - Assertions.assertEquals("jwfljhznamtua", model.workspaceName()); - Assertions.assertEquals("zwcjjncqtj", model.poolName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java deleted file mode 100644 index 35050793a9b8d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import com.azure.resourcemanager.machinelearning.models.SynapseSpark; -import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties; -import org.junit.jupiter.api.Assertions; - -public final class SynapseSparkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SynapseSpark model = - BinaryData - .fromString( - "{\"computeType\":\"SynapseSpark\",\"properties\":{\"autoScaleProperties\":{\"minNodeCount\":1214736566,\"enabled\":false,\"maxNodeCount\":576028683},\"autoPauseProperties\":{\"delayInMinutes\":909175637,\"enabled\":true},\"sparkVersion\":\"pedbwdpyqy\",\"nodeCount\":895891546,\"nodeSize\":\"bmdnafcbqwre\",\"nodeSizeFamily\":\"ela\",\"subscriptionId\":\"cigeleohdbvqvw\",\"resourceGroup\":\"jopwbeonrlkwz\",\"workspaceName\":\"ybxc\",\"poolName\":\"kxcpt\"},\"computeLocation\":\"qfyiaseqchkr\",\"provisioningState\":\"Canceled\",\"description\":\"azisgyk\",\"createdOn\":\"2021-05-23T19:22:14Z\",\"modifiedOn\":\"2021-11-23T05:48:50Z\",\"resourceId\":\"nbwzohmnrxxbso\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}") - .toObject(SynapseSpark.class); - Assertions.assertEquals("qfyiaseqchkr", model.computeLocation()); - Assertions.assertEquals("azisgyk", model.description()); - Assertions.assertEquals("nbwzohmnrxxbso", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(1214736566, model.properties().autoScaleProperties().minNodeCount()); - Assertions.assertEquals(false, model.properties().autoScaleProperties().enabled()); - Assertions.assertEquals(576028683, model.properties().autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(909175637, model.properties().autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.properties().autoPauseProperties().enabled()); - Assertions.assertEquals("pedbwdpyqy", model.properties().sparkVersion()); - Assertions.assertEquals(895891546, model.properties().nodeCount()); - Assertions.assertEquals("bmdnafcbqwre", model.properties().nodeSize()); - Assertions.assertEquals("ela", model.properties().nodeSizeFamily()); - Assertions.assertEquals("cigeleohdbvqvw", model.properties().subscriptionId()); - Assertions.assertEquals("jopwbeonrlkwz", model.properties().resourceGroup()); - Assertions.assertEquals("ybxc", model.properties().workspaceName()); - Assertions.assertEquals("kxcpt", model.properties().poolName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SynapseSpark model = - new SynapseSpark() - .withComputeLocation("qfyiaseqchkr") - .withDescription("azisgyk") - .withResourceId("nbwzohmnrxxbso") - .withDisableLocalAuth(false) - .withProperties( - new SynapseSparkProperties() - .withAutoScaleProperties( - new AutoScaleProperties() - .withMinNodeCount(1214736566) - .withEnabled(false) - .withMaxNodeCount(576028683)) - .withAutoPauseProperties( - new AutoPauseProperties().withDelayInMinutes(909175637).withEnabled(true)) - .withSparkVersion("pedbwdpyqy") - .withNodeCount(895891546) - .withNodeSize("bmdnafcbqwre") - .withNodeSizeFamily("ela") - .withSubscriptionId("cigeleohdbvqvw") - .withResourceGroup("jopwbeonrlkwz") - .withWorkspaceName("ybxc") - .withPoolName("kxcpt")); - model = BinaryData.fromObject(model).toObject(SynapseSpark.class); - Assertions.assertEquals("qfyiaseqchkr", model.computeLocation()); - Assertions.assertEquals("azisgyk", model.description()); - Assertions.assertEquals("nbwzohmnrxxbso", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(1214736566, model.properties().autoScaleProperties().minNodeCount()); - Assertions.assertEquals(false, model.properties().autoScaleProperties().enabled()); - Assertions.assertEquals(576028683, model.properties().autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(909175637, model.properties().autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.properties().autoPauseProperties().enabled()); - Assertions.assertEquals("pedbwdpyqy", model.properties().sparkVersion()); - Assertions.assertEquals(895891546, model.properties().nodeCount()); - Assertions.assertEquals("bmdnafcbqwre", model.properties().nodeSize()); - Assertions.assertEquals("ela", model.properties().nodeSizeFamily()); - Assertions.assertEquals("cigeleohdbvqvw", model.properties().subscriptionId()); - Assertions.assertEquals("jopwbeonrlkwz", model.properties().resourceGroup()); - Assertions.assertEquals("ybxc", model.properties().workspaceName()); - Assertions.assertEquals("kxcpt", model.properties().poolName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java deleted file mode 100644 index 0680a3ac90f13..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SystemService; - -public final class SystemServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemService model = - BinaryData - .fromString( - "{\"systemServiceType\":\"gcgbjb\",\"publicIpAddress\":\"lfgtdysnaquflqbc\",\"version\":\"hamzjrwdkqze\"}") - .toObject(SystemService.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemService model = new SystemService(); - model = BinaryData.fromObject(model).toObject(SystemService.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java deleted file mode 100644 index bd094cd3e34b7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.ColumnTransformer; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalFeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVerticalFeaturizationSettings model = - BinaryData - .fromString( - "{\"blockedTransformers\":[\"TextTargetEncoder\"],\"columnNameAndTypes\":{\"qyv\":\"blhtjq\",\"a\":\"eh\"},\"enableDnnFeaturization\":false,\"mode\":\"Auto\",\"transformerParams\":{\"tjvv\":[{\"fields\":[\"usxivzrrryvei\",\"ipsk\"],\"parameters\":\"datazatvfuzka\"}]},\"datasetLanguage\":\"xwigsye\"}") - .toObject(TableVerticalFeaturizationSettings.class); - Assertions.assertEquals("xwigsye", model.datasetLanguage()); - Assertions.assertEquals(BlockedTransformers.TEXT_TARGET_ENCODER, model.blockedTransformers().get(0)); - Assertions.assertEquals("blhtjq", model.columnNameAndTypes().get("qyv")); - Assertions.assertEquals(false, model.enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.mode()); - Assertions.assertEquals("usxivzrrryvei", model.transformerParams().get("tjvv").get(0).fields().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVerticalFeaturizationSettings model = - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("xwigsye") - .withBlockedTransformers(Arrays.asList(BlockedTransformers.TEXT_TARGET_ENCODER)) - .withColumnNameAndTypes(mapOf("qyv", "blhtjq", "a", "eh")) - .withEnableDnnFeaturization(false) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams( - mapOf( - "tjvv", - Arrays - .asList( - new ColumnTransformer() - .withFields(Arrays.asList("usxivzrrryvei", "ipsk")) - .withParameters("datazatvfuzka")))); - model = BinaryData.fromObject(model).toObject(TableVerticalFeaturizationSettings.class); - Assertions.assertEquals("xwigsye", model.datasetLanguage()); - Assertions.assertEquals(BlockedTransformers.TEXT_TARGET_ENCODER, model.blockedTransformers().get(0)); - Assertions.assertEquals("blhtjq", model.columnNameAndTypes().get("qyv")); - Assertions.assertEquals(false, model.enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.mode()); - Assertions.assertEquals("usxivzrrryvei", model.transformerParams().get("tjvv").get(0).fields().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java deleted file mode 100644 index e6eec1743952d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVerticalLimitSettings model = - BinaryData - .fromString( - "{\"enableEarlyTermination\":false,\"exitScore\":93.94093189506944,\"maxConcurrentTrials\":976047571,\"maxCoresPerTrial\":1086162181,\"maxTrials\":943881137,\"timeout\":\"PT74H46M4S\",\"trialTimeout\":\"PT5H4M5S\"}") - .toObject(TableVerticalLimitSettings.class); - Assertions.assertEquals(false, model.enableEarlyTermination()); - Assertions.assertEquals(93.94093189506944D, model.exitScore()); - Assertions.assertEquals(976047571, model.maxConcurrentTrials()); - Assertions.assertEquals(1086162181, model.maxCoresPerTrial()); - Assertions.assertEquals(943881137, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT74H46M4S"), model.timeout()); - Assertions.assertEquals(Duration.parse("PT5H4M5S"), model.trialTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVerticalLimitSettings model = - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(93.94093189506944D) - .withMaxConcurrentTrials(976047571) - .withMaxCoresPerTrial(1086162181) - .withMaxTrials(943881137) - .withTimeout(Duration.parse("PT74H46M4S")) - .withTrialTimeout(Duration.parse("PT5H4M5S")); - model = BinaryData.fromObject(model).toObject(TableVerticalLimitSettings.class); - Assertions.assertEquals(false, model.enableEarlyTermination()); - Assertions.assertEquals(93.94093189506944D, model.exitScore()); - Assertions.assertEquals(976047571, model.maxConcurrentTrials()); - Assertions.assertEquals(1086162181, model.maxCoresPerTrial()); - Assertions.assertEquals(943881137, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT74H46M4S"), model.timeout()); - Assertions.assertEquals(Duration.parse("PT5H4M5S"), model.trialTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java deleted file mode 100644 index a45b8e331985c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.TableVertical; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVertical model = - BinaryData - .fromString( - "{\"cvSplitColumnNames\":[\"aqkue\",\"tgroesh\"],\"featurizationSettings\":{\"blockedTransformers\":[\"LabelEncoder\",\"CountVectorizer\"],\"columnNameAndTypes\":{\"vjmvqmtdwckygr\":\"qxkfaoytehqp\",\"kb\":\"ejnndljdju\",\"n\":\"req\"},\"enableDnnFeaturization\":true,\"mode\":\"Auto\",\"transformerParams\":{\"egplwr\":[]},\"datasetLanguage\":\"hwddkvbxgkq\"},\"limitSettings\":{\"enableEarlyTermination\":true,\"exitScore\":58.74936526740298,\"maxConcurrentTrials\":1893356146,\"maxCoresPerTrial\":1883292844,\"maxTrials\":501930478,\"timeout\":\"PT193H51M55S\",\"trialTimeout\":\"PT46H37M35S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"poi\",\"description\":\"naz\"},\"testDataSize\":59.15029219925634,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"qalsxkd\",\"description\":\"qapfgsdpc\"},\"validationDataSize\":60.92552835591164,\"weightColumnName\":\"zhhkuuipldqqc\"}") - .toObject(TableVertical.class); - Assertions.assertEquals("aqkue", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("hwddkvbxgkq", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.LABEL_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("qxkfaoytehqp", model.featurizationSettings().columnNameAndTypes().get("vjmvqmtdwckygr")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(58.74936526740298D, model.limitSettings().exitScore()); - Assertions.assertEquals(1893356146, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1883292844, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(501930478, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT193H51M55S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT46H37M35S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("naz", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("poi", model.testData().uri()); - Assertions.assertEquals(59.15029219925634D, model.testDataSize()); - Assertions.assertEquals("qapfgsdpc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("qalsxkd", model.validationData().uri()); - Assertions.assertEquals(60.92552835591164D, model.validationDataSize()); - Assertions.assertEquals("zhhkuuipldqqc", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVertical model = - new TableVertical() - .withCvSplitColumnNames(Arrays.asList("aqkue", "tgroesh")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("hwddkvbxgkq") - .withBlockedTransformers( - Arrays.asList(BlockedTransformers.LABEL_ENCODER, BlockedTransformers.COUNT_VECTORIZER)) - .withColumnNameAndTypes(mapOf("vjmvqmtdwckygr", "qxkfaoytehqp", "kb", "ejnndljdju", "n", "req")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams(mapOf("egplwr", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(true) - .withExitScore(58.74936526740298D) - .withMaxConcurrentTrials(1893356146) - .withMaxCoresPerTrial(1883292844) - .withMaxTrials(501930478) - .withTimeout(Duration.parse("PT193H51M55S")) - .withTrialTimeout(Duration.parse("PT46H37M35S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("naz") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("poi")) - .withTestDataSize(59.15029219925634D) - .withValidationData( - new MLTableJobInput() - .withDescription("qapfgsdpc") - .withMode(InputDeliveryMode.DIRECT) - .withUri("qalsxkd")) - .withValidationDataSize(60.92552835591164D) - .withWeightColumnName("zhhkuuipldqqc"); - model = BinaryData.fromObject(model).toObject(TableVertical.class); - Assertions.assertEquals("aqkue", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("hwddkvbxgkq", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.LABEL_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("qxkfaoytehqp", model.featurizationSettings().columnNameAndTypes().get("vjmvqmtdwckygr")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(58.74936526740298D, model.limitSettings().exitScore()); - Assertions.assertEquals(1893356146, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1883292844, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(501930478, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT193H51M55S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT46H37M35S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("naz", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("poi", model.testData().uri()); - Assertions.assertEquals(59.15029219925634D, model.testDataSize()); - Assertions.assertEquals("qapfgsdpc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("qalsxkd", model.validationData().uri()); - Assertions.assertEquals(60.92552835591164D, model.validationDataSize()); - Assertions.assertEquals("zhhkuuipldqqc", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java deleted file mode 100644 index 529ec59a2e017..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetLags; - -public final class TargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetLags model = BinaryData.fromString("{\"mode\":\"TargetLags\"}").toObject(TargetLags.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetLags model = new TargetLags(); - model = BinaryData.fromObject(model).toObject(TargetLags.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java deleted file mode 100644 index c8c6218362872..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; - -public final class TargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"TargetRollingWindowSize\"}").toObject(TargetRollingWindowSize.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetRollingWindowSize model = new TargetRollingWindowSize(); - model = BinaryData.fromObject(model).toObject(TargetRollingWindowSize.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java deleted file mode 100644 index 078f8865a89f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetUtilizationScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TargetUtilizationScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetUtilizationScaleSettings model = - BinaryData - .fromString( - "{\"scaleType\":\"TargetUtilization\",\"maxInstances\":1095681099,\"minInstances\":1317358877,\"pollingInterval\":\"PT10H14M39S\",\"targetUtilizationPercentage\":93995844}") - .toObject(TargetUtilizationScaleSettings.class); - Assertions.assertEquals(1095681099, model.maxInstances()); - Assertions.assertEquals(1317358877, model.minInstances()); - Assertions.assertEquals(Duration.parse("PT10H14M39S"), model.pollingInterval()); - Assertions.assertEquals(93995844, model.targetUtilizationPercentage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetUtilizationScaleSettings model = - new TargetUtilizationScaleSettings() - .withMaxInstances(1095681099) - .withMinInstances(1317358877) - .withPollingInterval(Duration.parse("PT10H14M39S")) - .withTargetUtilizationPercentage(93995844); - model = BinaryData.fromObject(model).toObject(TargetUtilizationScaleSettings.class); - Assertions.assertEquals(1095681099, model.maxInstances()); - Assertions.assertEquals(1317358877, model.minInstances()); - Assertions.assertEquals(Duration.parse("PT10H14M39S"), model.pollingInterval()); - Assertions.assertEquals(93995844, model.targetUtilizationPercentage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java deleted file mode 100644 index 12ea722ac887a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TensorFlow; -import org.junit.jupiter.api.Assertions; - -public final class TensorFlowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TensorFlow model = - BinaryData - .fromString( - "{\"distributionType\":\"TensorFlow\",\"parameterServerCount\":1873881024,\"workerCount\":131974478}") - .toObject(TensorFlow.class); - Assertions.assertEquals(1873881024, model.parameterServerCount()); - Assertions.assertEquals(131974478, model.workerCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TensorFlow model = new TensorFlow().withParameterServerCount(1873881024).withWorkerCount(131974478); - model = BinaryData.fromObject(model).toObject(TensorFlow.class); - Assertions.assertEquals(1873881024, model.parameterServerCount()); - Assertions.assertEquals(131974478, model.workerCount()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java deleted file mode 100644 index 04eaf93fc5416..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextClassificationMultilabel; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextClassificationMultilabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextClassificationMultilabel model = - BinaryData - .fromString( - "{\"taskType\":\"TextClassificationMultilabel\",\"primaryMetric\":\"AveragePrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"klt\"},\"limitSettings\":{\"maxConcurrentTrials\":1366135748,\"maxTrials\":1224275689,\"timeout\":\"PT25H21M12S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"grdcgubsrtmdy\",\"description\":\"erpi\"},\"logVerbosity\":\"Warning\",\"targetColumnName\":\"zgczfcmfpfbode\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"sr\",\"description\":\"tshuvftwaivm\"}}") - .toObject(TextClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("zgczfcmfpfbode", model.targetColumnName()); - Assertions.assertEquals("tshuvftwaivm", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("sr", model.trainingData().uri()); - Assertions.assertEquals("klt", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1366135748, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1224275689, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT25H21M12S"), model.limitSettings().timeout()); - Assertions.assertEquals("erpi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("grdcgubsrtmdy", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextClassificationMultilabel model = - new TextClassificationMultilabel() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("zgczfcmfpfbode") - .withTrainingData( - new MLTableJobInput() - .withDescription("tshuvftwaivm") - .withMode(InputDeliveryMode.DIRECT) - .withUri("sr")) - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("klt")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1366135748) - .withMaxTrials(1224275689) - .withTimeout(Duration.parse("PT25H21M12S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("erpi") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("grdcgubsrtmdy")); - model = BinaryData.fromObject(model).toObject(TextClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("zgczfcmfpfbode", model.targetColumnName()); - Assertions.assertEquals("tshuvftwaivm", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("sr", model.trainingData().uri()); - Assertions.assertEquals("klt", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1366135748, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1224275689, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT25H21M12S"), model.limitSettings().timeout()); - Assertions.assertEquals("erpi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("grdcgubsrtmdy", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java deleted file mode 100644 index cc6b6e0733ab8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextClassification; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextClassification model = - BinaryData - .fromString( - "{\"taskType\":\"TextClassification\",\"primaryMetric\":\"AveragePrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"tsffo\"},\"limitSettings\":{\"maxConcurrentTrials\":650758189,\"maxTrials\":560959800,\"timeout\":\"PT174H2M54S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"w\",\"description\":\"cgwdfriwgybjp\"},\"logVerbosity\":\"Warning\",\"targetColumnName\":\"scvgl\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"dgbyfgwewqkjvxp\",\"description\":\"pxsoohu\"}}") - .toObject(TextClassification.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("scvgl", model.targetColumnName()); - Assertions.assertEquals("pxsoohu", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("dgbyfgwewqkjvxp", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED, model.primaryMetric()); - Assertions.assertEquals("tsffo", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(650758189, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(560959800, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT174H2M54S"), model.limitSettings().timeout()); - Assertions.assertEquals("cgwdfriwgybjp", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("w", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextClassification model = - new TextClassification() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("scvgl") - .withTrainingData( - new MLTableJobInput() - .withDescription("pxsoohu") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("dgbyfgwewqkjvxp")) - .withPrimaryMetric(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED) - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("tsffo")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(650758189) - .withMaxTrials(560959800) - .withTimeout(Duration.parse("PT174H2M54S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("cgwdfriwgybjp") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("w")); - model = BinaryData.fromObject(model).toObject(TextClassification.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("scvgl", model.targetColumnName()); - Assertions.assertEquals("pxsoohu", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("dgbyfgwewqkjvxp", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED, model.primaryMetric()); - Assertions.assertEquals("tsffo", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(650758189, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(560959800, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT174H2M54S"), model.limitSettings().timeout()); - Assertions.assertEquals("cgwdfriwgybjp", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("w", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java deleted file mode 100644 index 66c830fc80a6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextNer; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextNerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextNer model = - BinaryData - .fromString( - "{\"taskType\":\"TextNER\",\"primaryMetric\":\"PrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"zgjypanhxmpdxxz\"},\"limitSettings\":{\"maxConcurrentTrials\":1172972444,\"maxTrials\":1745453139,\"timeout\":\"PT16H13M18S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"lkfhglhrfoxqwec\",\"description\":\"nhpcselqx\"},\"logVerbosity\":\"Critical\",\"targetColumnName\":\"qibukklvzrl\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"ccmetjsczivfqb\",\"description\":\"asdsyenzsie\"}}") - .toObject(TextNer.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("qibukklvzrl", model.targetColumnName()); - Assertions.assertEquals("asdsyenzsie", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("ccmetjsczivfqb", model.trainingData().uri()); - Assertions.assertEquals("zgjypanhxmpdxxz", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1172972444, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1745453139, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT16H13M18S"), model.limitSettings().timeout()); - Assertions.assertEquals("nhpcselqx", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lkfhglhrfoxqwec", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextNer model = - new TextNer() - .withLogVerbosity(LogVerbosity.CRITICAL) - .withTargetColumnName("qibukklvzrl") - .withTrainingData( - new MLTableJobInput() - .withDescription("asdsyenzsie") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("ccmetjsczivfqb")) - .withFeaturizationSettings( - new NlpVerticalFeaturizationSettings().withDatasetLanguage("zgjypanhxmpdxxz")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1172972444) - .withMaxTrials(1745453139) - .withTimeout(Duration.parse("PT16H13M18S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("nhpcselqx") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("lkfhglhrfoxqwec")); - model = BinaryData.fromObject(model).toObject(TextNer.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("qibukklvzrl", model.targetColumnName()); - Assertions.assertEquals("asdsyenzsie", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("ccmetjsczivfqb", model.trainingData().uri()); - Assertions.assertEquals("zgjypanhxmpdxxz", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1172972444, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1745453139, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT16H13M18S"), model.limitSettings().timeout()); - Assertions.assertEquals("nhpcselqx", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lkfhglhrfoxqwec", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java deleted file mode 100644 index c92f459fe17f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TrainingSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrainingSettings model = - BinaryData - .fromString( - "{\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT109H29M10S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datajtasbvwispk\",\"stackMetaLearnerTrainPercentage\":99.23936213293845,\"stackMetaLearnerType\":\"LogisticRegressionCV\"}}") - .toObject(TrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT109H29M10S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(99.23936213293845D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LOGISTIC_REGRESSION_CV, model.stackEnsembleSettings().stackMetaLearnerType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrainingSettings model = - new TrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT109H29M10S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datajtasbvwispk") - .withStackMetaLearnerTrainPercentage(99.23936213293845D) - .withStackMetaLearnerType(StackMetaLearnerType.LOGISTIC_REGRESSION_CV)); - model = BinaryData.fromObject(model).toObject(TrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT109H29M10S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(99.23936213293845D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LOGISTIC_REGRESSION_CV, model.stackEnsembleSettings().stackMetaLearnerType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java deleted file mode 100644 index 5983c0e76c29c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import org.junit.jupiter.api.Assertions; - -public final class TriggerBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TriggerBase model = - BinaryData - .fromString( - "{\"triggerType\":\"TriggerBase\",\"endTime\":\"plucfotangcfhnyk\",\"startTime\":\"ugswvx\",\"timeZone\":\"mzqwmvtxnjmxmcu\"}") - .toObject(TriggerBase.class); - Assertions.assertEquals("plucfotangcfhnyk", model.endTime()); - Assertions.assertEquals("ugswvx", model.startTime()); - Assertions.assertEquals("mzqwmvtxnjmxmcu", model.timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TriggerBase model = - new TriggerBase().withEndTime("plucfotangcfhnyk").withStartTime("ugswvx").withTimeZone("mzqwmvtxnjmxmcu"); - model = BinaryData.fromObject(model).toObject(TriggerBase.class); - Assertions.assertEquals("plucfotangcfhnyk", model.endTime()); - Assertions.assertEquals("ugswvx", model.startTime()); - Assertions.assertEquals("mzqwmvtxnjmxmcu", model.timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java deleted file mode 100644 index e2370f8f1842e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobInput; -import org.junit.jupiter.api.Assertions; - -public final class TritonModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TritonModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"triton_model\",\"mode\":\"Download\",\"uri\":\"plhyvd\",\"description\":\"lyzkxitds\"}") - .toObject(TritonModelJobInput.class); - Assertions.assertEquals("lyzkxitds", model.description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.mode()); - Assertions.assertEquals("plhyvd", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TritonModelJobInput model = - new TritonModelJobInput() - .withDescription("lyzkxitds") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("plhyvd"); - model = BinaryData.fromObject(model).toObject(TritonModelJobInput.class); - Assertions.assertEquals("lyzkxitds", model.description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.mode()); - Assertions.assertEquals("plhyvd", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java deleted file mode 100644 index 55fbe2e470fec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class TritonModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TritonModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"triton_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"vkolrupjovmo\",\"description\":\"ayeb\"}") - .toObject(TritonModelJobOutput.class); - Assertions.assertEquals("ayeb", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("vkolrupjovmo", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TritonModelJobOutput model = - new TritonModelJobOutput() - .withDescription("ayeb") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("vkolrupjovmo"); - model = BinaryData.fromObject(model).toObject(TritonModelJobOutput.class); - Assertions.assertEquals("ayeb", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("vkolrupjovmo", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java deleted file mode 100644 index 904af93fa3557..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TruncationSelectionPolicy; -import org.junit.jupiter.api.Assertions; - -public final class TruncationSelectionPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TruncationSelectionPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"TruncationSelection\",\"truncationPercentage\":1106944697,\"delayEvaluation\":674073421,\"evaluationInterval\":1924509674}") - .toObject(TruncationSelectionPolicy.class); - Assertions.assertEquals(674073421, model.delayEvaluation()); - Assertions.assertEquals(1924509674, model.evaluationInterval()); - Assertions.assertEquals(1106944697, model.truncationPercentage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TruncationSelectionPolicy model = - new TruncationSelectionPolicy() - .withDelayEvaluation(674073421) - .withEvaluationInterval(1924509674) - .withTruncationPercentage(1106944697); - model = BinaryData.fromObject(model).toObject(TruncationSelectionPolicy.class); - Assertions.assertEquals(674073421, model.delayEvaluation()); - Assertions.assertEquals(1924509674, model.evaluationInterval()); - Assertions.assertEquals(1106944697, model.truncationPercentage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java deleted file mode 100644 index acdc83131e6c3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner; - -public final class UpdateWorkspaceQuotasResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateWorkspaceQuotasResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"dxwzywqsmbsurexi\",\"type\":\"ryocfsfksymdd\",\"limit\":2863300785135771862,\"unit\":\"Count\",\"status\":\"OperationNotSupportedForSku\"},{\"id\":\"qyud\",\"type\":\"rrqnbpoczvyifqrv\",\"limit\":4225896230813201107,\"unit\":\"Count\",\"status\":\"Undefined\"},{\"id\":\"vvdfwatkpnpul\",\"type\":\"xbczwtruwiqz\",\"limit\":535203573928767895,\"unit\":\"Count\",\"status\":\"InvalidVMFamilyName\"},{\"id\":\"okacspk\",\"type\":\"hzdobpxjmflbvvnc\",\"limit\":5158769929678256713,\"unit\":\"Count\",\"status\":\"Failure\"}],\"nextLink\":\"juqk\"}") - .toObject(UpdateWorkspaceQuotasResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateWorkspaceQuotasResultInner model = new UpdateWorkspaceQuotasResultInner(); - model = BinaryData.fromObject(model).toObject(UpdateWorkspaceQuotasResultInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java deleted file mode 100644 index 4b480a366fbf9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Status; -import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotas; -import org.junit.jupiter.api.Assertions; - -public final class UpdateWorkspaceQuotasTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateWorkspaceQuotas model = - BinaryData - .fromString( - "{\"id\":\"sa\",\"type\":\"wkuofoskghsauu\",\"limit\":6549860277400431394,\"unit\":\"Count\",\"status\":\"Failure\"}") - .toObject(UpdateWorkspaceQuotas.class); - Assertions.assertEquals(6549860277400431394L, model.limit()); - Assertions.assertEquals(Status.FAILURE, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateWorkspaceQuotas model = - new UpdateWorkspaceQuotas().withLimit(6549860277400431394L).withStatus(Status.FAILURE); - model = BinaryData.fromObject(model).toObject(UpdateWorkspaceQuotas.class); - Assertions.assertEquals(6549860277400431394L, model.limit()); - Assertions.assertEquals(Status.FAILURE, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java deleted file mode 100644 index d99e7f294cc1b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UriFileDataVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileDataVersion model = - BinaryData - .fromString( - "{\"dataType\":\"uri_file\",\"dataUri\":\"zbtz\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"pfs\",\"properties\":{\"ezacfpztga\":\"pfnocm\",\"ctgkppgkqzkcyzmf\":\"wyqejgaao\"},\"tags\":{\"hlcqvhoe\":\"dyfcix\",\"mkahpqha\":\"goiutgw\",\"mip\":\"yntacihnco\",\"i\":\"mliqmvlb\"}}") - .toObject(UriFileDataVersion.class); - Assertions.assertEquals("pfs", model.description()); - Assertions.assertEquals("pfnocm", model.properties().get("ezacfpztga")); - Assertions.assertEquals("dyfcix", model.tags().get("hlcqvhoe")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("zbtz", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileDataVersion model = - new UriFileDataVersion() - .withDescription("pfs") - .withProperties(mapOf("ezacfpztga", "pfnocm", "ctgkppgkqzkcyzmf", "wyqejgaao")) - .withTags(mapOf("hlcqvhoe", "dyfcix", "mkahpqha", "goiutgw", "mip", "yntacihnco", "i", "mliqmvlb")) - .withIsAnonymous(true) - .withIsArchived(true) - .withDataUri("zbtz"); - model = BinaryData.fromObject(model).toObject(UriFileDataVersion.class); - Assertions.assertEquals("pfs", model.description()); - Assertions.assertEquals("pfnocm", model.properties().get("ezacfpztga")); - Assertions.assertEquals("dyfcix", model.tags().get("hlcqvhoe")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("zbtz", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java deleted file mode 100644 index a0df6aaca2b71..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobInput; -import org.junit.jupiter.api.Assertions; - -public final class UriFileJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"uri_file\",\"mode\":\"ReadOnlyMount\",\"uri\":\"qgrvg\",\"description\":\"mxpu\"}") - .toObject(UriFileJobInput.class); - Assertions.assertEquals("mxpu", model.description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("qgrvg", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileJobInput model = - new UriFileJobInput().withDescription("mxpu").withMode(InputDeliveryMode.READ_ONLY_MOUNT).withUri("qgrvg"); - model = BinaryData.fromObject(model).toObject(UriFileJobInput.class); - Assertions.assertEquals("mxpu", model.description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("qgrvg", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java deleted file mode 100644 index 60c97ca9dc200..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class UriFileJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"uri_file\",\"mode\":\"Upload\",\"uri\":\"dfj\",\"description\":\"esocwiqbuou\"}") - .toObject(UriFileJobOutput.class); - Assertions.assertEquals("esocwiqbuou", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("dfj", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileJobOutput model = - new UriFileJobOutput().withDescription("esocwiqbuou").withMode(OutputDeliveryMode.UPLOAD).withUri("dfj"); - model = BinaryData.fromObject(model).toObject(UriFileJobOutput.class); - Assertions.assertEquals("esocwiqbuou", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("dfj", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java deleted file mode 100644 index 6d354ce0c424a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UriFolderDataVersion; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderDataVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderDataVersion model = - BinaryData - .fromString( - "{\"dataType\":\"uri_folder\",\"dataUri\":\"mpyzgleo\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"wwzvdaj\",\"properties\":{\"fmaciqgjjrlhiq\":\"n\",\"jtt\":\"wixvtbouguxtndop\",\"bkixvvlwyn\":\"asualapdlndbea\",\"qvzfj\":\"bb\"},\"tags\":{\"mphfkyezolgjzm\":\"ugzfeuzjl\"}}") - .toObject(UriFolderDataVersion.class); - Assertions.assertEquals("wwzvdaj", model.description()); - Assertions.assertEquals("n", model.properties().get("fmaciqgjjrlhiq")); - Assertions.assertEquals("ugzfeuzjl", model.tags().get("mphfkyezolgjzm")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("mpyzgleo", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderDataVersion model = - new UriFolderDataVersion() - .withDescription("wwzvdaj") - .withProperties( - mapOf( - "fmaciqgjjrlhiq", - "n", - "jtt", - "wixvtbouguxtndop", - "bkixvvlwyn", - "asualapdlndbea", - "qvzfj", - "bb")) - .withTags(mapOf("mphfkyezolgjzm", "ugzfeuzjl")) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("mpyzgleo"); - model = BinaryData.fromObject(model).toObject(UriFolderDataVersion.class); - Assertions.assertEquals("wwzvdaj", model.description()); - Assertions.assertEquals("n", model.properties().get("fmaciqgjjrlhiq")); - Assertions.assertEquals("ugzfeuzjl", model.tags().get("mphfkyezolgjzm")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("mpyzgleo", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java deleted file mode 100644 index b1e8226f6f181..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobInput; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"uri_folder\",\"mode\":\"EvalMount\",\"uri\":\"ydoccnxshanzb\",\"description\":\"adh\"}") - .toObject(UriFolderJobInput.class); - Assertions.assertEquals("adh", model.description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.mode()); - Assertions.assertEquals("ydoccnxshanzb", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderJobInput model = - new UriFolderJobInput() - .withDescription("adh") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("ydoccnxshanzb"); - model = BinaryData.fromObject(model).toObject(UriFolderJobInput.class); - Assertions.assertEquals("adh", model.description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.mode()); - Assertions.assertEquals("ydoccnxshanzb", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java deleted file mode 100644 index 7511a7ec6d454..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"uri_folder\",\"mode\":\"ReadWriteMount\",\"uri\":\"caatsdohzniucbda\",\"description\":\"b\"}") - .toObject(UriFolderJobOutput.class); - Assertions.assertEquals("b", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("caatsdohzniucbda", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderJobOutput model = - new UriFolderJobOutput() - .withDescription("b") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("caatsdohzniucbda"); - model = BinaryData.fromObject(model).toObject(UriFolderJobOutput.class); - Assertions.assertEquals("b", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("caatsdohzniucbda", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java deleted file mode 100644 index dc5abc4da1a03..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.UsageInner; - -public final class UsageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageInner model = - BinaryData - .fromString( - "{\"id\":\"al\",\"amlWorkspaceLocation\":\"wsubisnja\",\"type\":\"mngnzscxaqw\",\"unit\":\"Count\",\"currentValue\":8284849522775064668,\"limit\":4293534997392812714,\"name\":{\"value\":\"kvlrxnj\",\"localizedValue\":\"seiphe\"}}") - .toObject(UsageInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageInner model = new UsageInner(); - model = BinaryData.fromObject(model).toObject(UsageInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java deleted file mode 100644 index 51468bd4dbf33..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UsageName; - -public final class UsageNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageName model = - BinaryData.fromString("{\"value\":\"lokeyy\",\"localizedValue\":\"nj\"}").toObject(UsageName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageName model = new UsageName(); - model = BinaryData.fromObject(model).toObject(UsageName.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java deleted file mode 100644 index 11d6eafc68b83..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Usage; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"dxku\",\"amlWorkspaceLocation\":\"kczynuhhoqeqsh\",\"type\":\"ljqkxyrqolnthbb\",\"unit\":\"Count\",\"currentValue\":6327166092096941565,\"limit\":45876676244603547,\"name\":{\"value\":\"kjthfce\",\"localizedValue\":\"ncjmlfuyf\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.usages().list("aaxoialahfxwcc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 9233f673cb974..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"482ca507-d71f-4817-b618-8233dec4afc2\",\"clientId\":\"08c17000-9968-4d5e-b89a-5cd50023b58b\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java deleted file mode 100644 index a6544cd230123..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UserIdentity; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = BinaryData.fromString("{\"identityType\":\"UserIdentity\"}").toObject(UserIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity(); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java deleted file mode 100644 index d5961556e5fd4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineImageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineImage model = - BinaryData.fromString("{\"id\":\"vbopfppdbwnu\"}").toObject(VirtualMachineImage.class); - Assertions.assertEquals("vbopfppdbwnu", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineImage model = new VirtualMachineImage().withId("vbopfppdbwnu"); - model = BinaryData.fromObject(model).toObject(VirtualMachineImage.class); - Assertions.assertEquals("vbopfppdbwnu", model.id()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java deleted file mode 100644 index 9f29c5acc8d01..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSize; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineSizeListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineSizeListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"tgrhpdjpjumas\",\"family\":\"zj\",\"vCPUs\":1063088657,\"gpus\":973371108,\"osVhdSizeMB\":1267309720,\"maxResourceVolumeMB\":285130790,\"memoryGB\":62.19358841158077,\"lowPriorityCapable\":false,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"dgwdslfhot\",\"mcy\",\"pwlbjnpg\"]},{\"name\":\"ftadehxnltyfs\",\"family\":\"pusuesn\",\"vCPUs\":1828932864,\"gpus\":317621756,\"osVhdSizeMB\":600821678,\"maxResourceVolumeMB\":1696341054,\"memoryGB\":51.36310108881028,\"lowPriorityCapable\":false,\"premiumIO\":true,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"udwxdndnvowguj\",\"ugw\"]},{\"name\":\"cglhslazjdyggdt\",\"family\":\"xhbkuofq\",\"vCPUs\":358956997,\"gpus\":1965159297,\"osVhdSizeMB\":1807410645,\"maxResourceVolumeMB\":1520793095,\"memoryGB\":45.72291424975317,\"lowPriorityCapable\":false,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"bvyvdcsity\"]}]}") - .toObject(VirtualMachineSizeListResultInner.class); - Assertions.assertEquals(BillingCurrency.USD, model.value().get(0).estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.value().get(0).estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).supportedComputeTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineSizeListResultInner model = - new VirtualMachineSizeListResultInner() - .withValue( - Arrays - .asList( - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("dgwdslfhot", "mcy", "pwlbjnpg")), - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("udwxdndnvowguj", "ugw")), - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("bvyvdcsity")))); - model = BinaryData.fromObject(model).toObject(VirtualMachineSizeListResultInner.class); - Assertions.assertEquals(BillingCurrency.USD, model.value().get(0).estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.value().get(0).estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java deleted file mode 100644 index cf90d3601f44b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSize; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineSize model = - BinaryData - .fromString( - "{\"name\":\"aamdect\",\"family\":\"f\",\"vCPUs\":1860942440,\"gpus\":993666965,\"osVhdSizeMB\":230831104,\"maxResourceVolumeMB\":796129419,\"memoryGB\":78.8172659538708,\"lowPriorityCapable\":true,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[{\"retailPrice\":43.63741417101916,\"osType\":\"Linux\",\"vmTier\":\"Standard\"},{\"retailPrice\":10.488278430863074,\"osType\":\"Windows\",\"vmTier\":\"LowPriority\"},{\"retailPrice\":12.69677181728943,\"osType\":\"Windows\",\"vmTier\":\"Standard\"},{\"retailPrice\":38.22056349066922,\"osType\":\"Linux\",\"vmTier\":\"LowPriority\"}]},\"supportedComputeTypes\":[\"pkc\",\"t\",\"pngjcrcczsqpjhvm\"]}") - .toObject(VirtualMachineSize.class); - Assertions.assertEquals(BillingCurrency.USD, model.estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals(43.63741417101916, model.estimatedVMPrices().values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.estimatedVMPrices().values().get(0).osType()); - Assertions.assertEquals(VMTier.STANDARD, model.estimatedVMPrices().values().get(0).vmTier()); - Assertions.assertEquals("pkc", model.supportedComputeTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineSize model = - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues( - Arrays - .asList( - new EstimatedVMPrice() - .withRetailPrice(43.63741417101916) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.STANDARD), - new EstimatedVMPrice() - .withRetailPrice(10.488278430863074) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.LOW_PRIORITY), - new EstimatedVMPrice() - .withRetailPrice(12.69677181728943) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.STANDARD), - new EstimatedVMPrice() - .withRetailPrice(38.22056349066922) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.LOW_PRIORITY)))) - .withSupportedComputeTypes(Arrays.asList("pkc", "t", "pngjcrcczsqpjhvm")); - model = BinaryData.fromObject(model).toObject(VirtualMachineSize.class); - Assertions.assertEquals(BillingCurrency.USD, model.estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals(43.63741417101916, model.estimatedVMPrices().values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.estimatedVMPrices().values().get(0).osType()); - Assertions.assertEquals(VMTier.STANDARD, model.estimatedVMPrices().values().get(0).vmTier()); - Assertions.assertEquals("pkc", model.supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java deleted file mode 100644 index 8669b4c6f1477..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSizeListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VirtualMachineSizesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"mq\",\"family\":\"uiocuselqkrsazr\",\"vCPUs\":907855670,\"gpus\":162147994,\"osVhdSizeMB\":1160671233,\"maxResourceVolumeMB\":1893332175,\"memoryGB\":44.634673287925494,\"lowPriorityCapable\":false,\"premiumIO\":true,\"supportedComputeTypes\":[\"mw\",\"mdlgy\",\"ixokwtjawhv\",\"gnqfqqdlcvmyol\"]},{\"name\":\"ymjc\",\"family\":\"vsnvlaq\",\"vCPUs\":4380351,\"gpus\":1268203688,\"osVhdSizeMB\":1622025421,\"maxResourceVolumeMB\":2099242028,\"memoryGB\":84.58306289880801,\"lowPriorityCapable\":true,\"premiumIO\":true,\"supportedComputeTypes\":[\"thymgobl\",\"msn\",\"gwi\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualMachineSizeListResult response = - manager.virtualMachineSizes().listWithResponse("bpfiddhlrufz", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("mw", response.value().get(0).supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java deleted file mode 100644 index 2222100f20485..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionManagedIdentity; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionManagedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionManagedIdentity model = - BinaryData - .fromString("{\"resourceId\":\"ivensrpmeyyvpk\",\"clientId\":\"tlbijpzg\"}") - .toObject(WorkspaceConnectionManagedIdentity.class); - Assertions.assertEquals("ivensrpmeyyvpk", model.resourceId()); - Assertions.assertEquals("tlbijpzg", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionManagedIdentity model = - new WorkspaceConnectionManagedIdentity().withResourceId("ivensrpmeyyvpk").withClientId("tlbijpzg"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionManagedIdentity.class); - Assertions.assertEquals("ivensrpmeyyvpk", model.resourceId()); - Assertions.assertEquals("tlbijpzg", model.clientId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java deleted file mode 100644 index 67d94947eea1b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPersonalAccessToken; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPersonalAccessTokenTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPersonalAccessToken model = - BinaryData.fromString("{\"pat\":\"phuuuerctato\"}").toObject(WorkspaceConnectionPersonalAccessToken.class); - Assertions.assertEquals("phuuuerctato", model.pat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPersonalAccessToken model = - new WorkspaceConnectionPersonalAccessToken().withPat("phuuuerctato"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPersonalAccessToken.class); - Assertions.assertEquals("phuuuerctato", model.pat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java deleted file mode 100644 index a275c7a557c9d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"PythonFeed\",\"target\":\"yqsemwa\",\"value\":\"ets\",\"valueFormat\":\"JSON\"},\"id\":\"h\",\"name\":\"d\",\"type\":\"lvwiwubmwmbesl\"}],\"nextLink\":\"k\"}") - .toObject(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.value().get(0).properties().category()); - Assertions.assertEquals("yqsemwa", model.value().get(0).properties().target()); - Assertions.assertEquals("ets", model.value().get(0).properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.value().get(0).properties().valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model = - new WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult() - .withValue( - Arrays - .asList( - new WorkspaceConnectionPropertiesV2BasicResourceInner() - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("yqsemwa") - .withValue("ets") - .withValueFormat(ValueFormat.JSON)))); - model = - BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.value().get(0).properties().category()); - Assertions.assertEquals("yqsemwa", model.value().get(0).properties().target()); - Assertions.assertEquals("ets", model.value().get(0).properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.value().get(0).properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java deleted file mode 100644 index be9c021e2284b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2BasicResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"wiydmcwyhzdxssad\",\"value\":\"mnvdfzn\",\"valueFormat\":\"JSON\"},\"id\":\"dvxzbncblylpst\",\"name\":\"bhhxsrzdzuc\",\"type\":\"rsc\"}") - .toObject(WorkspaceConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("wiydmcwyhzdxssad", model.properties().target()); - Assertions.assertEquals("mnvdfzn", model.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.properties().valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceInner model = - new WorkspaceConnectionPropertiesV2BasicResourceInner() - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withTarget("wiydmcwyhzdxssad") - .withValue("mnvdfzn") - .withValueFormat(ValueFormat.JSON)); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("wiydmcwyhzdxssad", model.properties().target()); - Assertions.assertEquals("mnvdfzn", model.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java deleted file mode 100644 index 2c2c30c1704ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2 model = - BinaryData - .fromString( - "{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"PythonFeed\",\"target\":\"evfiwjmygt\",\"value\":\"slswtm\",\"valueFormat\":\"JSON\"}") - .toObject(WorkspaceConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.category()); - Assertions.assertEquals("evfiwjmygt", model.target()); - Assertions.assertEquals("slswtm", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2 model = - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("evfiwjmygt") - .withValue("slswtm") - .withValueFormat(ValueFormat.JSON); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.category()); - Assertions.assertEquals("evfiwjmygt", model.target()); - Assertions.assertEquals("slswtm", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java deleted file mode 100644 index bdf2992d956de..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionSharedAccessSignature; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionSharedAccessSignatureTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionSharedAccessSignature model = - BinaryData - .fromString("{\"sas\":\"uczkgofxyfsruc\"}") - .toObject(WorkspaceConnectionSharedAccessSignature.class); - Assertions.assertEquals("uczkgofxyfsruc", model.sas()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionSharedAccessSignature model = - new WorkspaceConnectionSharedAccessSignature().withSas("uczkgofxyfsruc"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionSharedAccessSignature.class); - Assertions.assertEquals("uczkgofxyfsruc", model.sas()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java deleted file mode 100644 index 14485908f4c21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"zuzhasup\",\"value\":\"p\",\"valueFormat\":\"JSON\"},\"id\":\"zvzqazvbkark\",\"name\":\"tgongrua\",\"type\":\"s\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceConnectionPropertiesV2BasicResource response = - manager - .workspaceConnections() - .define("rwqirvtktyhhmvf") - .withExistingWorkspace("ouigdmfivjqte", "dqqigdydkghpc") - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("jajodmkrr") - .withValue("pgqvqo") - .withValueFormat(ValueFormat.JSON)) - .create(); - - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, response.properties().category()); - Assertions.assertEquals("zuzhasup", response.properties().target()); - Assertions.assertEquals("p", response.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java deleted file mode 100644 index a777528a8091f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .workspaceConnections() - .deleteWithResponse("paczmuh", "cakznhokhoitwhrj", "dmmazdnc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 2cf32122e8280..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"gzhogsmgbvmtd\",\"value\":\"qbe\",\"valueFormat\":\"JSON\"},\"id\":\"veglabtvkbiwzn\",\"name\":\"tfgfic\",\"type\":\"dyhi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceConnectionPropertiesV2BasicResource response = - manager - .workspaceConnections() - .getWithResponse("ekymffztsilscvqs", "eiihfymko", "ihyeseu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, response.properties().category()); - Assertions.assertEquals("gzhogsmgbvmtd", response.properties().target()); - Assertions.assertEquals("qbe", response.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java deleted file mode 100644 index 741984a8bacd5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"Git\",\"target\":\"wh\",\"value\":\"xsure\",\"valueFormat\":\"JSON\"},\"id\":\"hzzbgullcxiqq\",\"name\":\"jkoxdupna\",\"type\":\"gl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .workspaceConnections() - .list("idb", "pglhzqp", "zbawkikcdgfh", "ssdpjeyoqxded", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ConnectionCategory.GIT, response.iterator().next().properties().category()); - Assertions.assertEquals("wh", response.iterator().next().properties().target()); - Assertions.assertEquals("xsure", response.iterator().next().properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.iterator().next().properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java deleted file mode 100644 index 3bcd57ce35a5e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlUserFeature; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceFeaturesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"kekzouyveww\",\"displayName\":\"rd\",\"description\":\"gldohgcandxfhh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.workspaceFeatures().list("wbmwdukinhl", "hg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kekzouyveww", response.iterator().next().id()); - Assertions.assertEquals("rd", response.iterator().next().displayName()); - Assertions.assertEquals("gldohgcandxfhh", response.iterator().next().description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java deleted file mode 100644 index e359ec0f65d2d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePropertiesUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePropertiesUpdateParameters model = - BinaryData - .fromString( - "{\"description\":\"qfou\",\"friendlyName\":\"mmnkzsmodmgl\",\"imageBuildCompute\":\"gpbkwtmut\",\"serviceManagedResourcesSettings\":{\"cosmosDb\":{\"collectionsThroughput\":289494577}},\"primaryUserAssignedIdentity\":\"pspwgcuertu\",\"publicNetworkAccess\":\"Disabled\",\"applicationInsights\":\"svqwhbmdgbbjfd\",\"containerRegistry\":\"mbmbexppbh\"}") - .toObject(WorkspacePropertiesUpdateParameters.class); - Assertions.assertEquals("qfou", model.description()); - Assertions.assertEquals("mmnkzsmodmgl", model.friendlyName()); - Assertions.assertEquals("gpbkwtmut", model.imageBuildCompute()); - Assertions.assertEquals(289494577, model.serviceManagedResourcesSettings().cosmosDb().collectionsThroughput()); - Assertions.assertEquals("pspwgcuertu", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.applicationInsights()); - Assertions.assertEquals("mbmbexppbh", model.containerRegistry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePropertiesUpdateParameters model = - new WorkspacePropertiesUpdateParameters() - .withDescription("qfou") - .withFriendlyName("mmnkzsmodmgl") - .withImageBuildCompute("gpbkwtmut") - .withServiceManagedResourcesSettings( - new ServiceManagedResourcesSettings() - .withCosmosDb(new CosmosDbSettings().withCollectionsThroughput(289494577))) - .withPrimaryUserAssignedIdentity("pspwgcuertu") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withApplicationInsights("svqwhbmdgbbjfd") - .withContainerRegistry("mbmbexppbh"); - model = BinaryData.fromObject(model).toObject(WorkspacePropertiesUpdateParameters.class); - Assertions.assertEquals("qfou", model.description()); - Assertions.assertEquals("mmnkzsmodmgl", model.friendlyName()); - Assertions.assertEquals("gpbkwtmut", model.imageBuildCompute()); - Assertions.assertEquals(289494577, model.serviceManagedResourcesSettings().cosmosDb().collectionsThroughput()); - Assertions.assertEquals("pspwgcuertu", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.applicationInsights()); - Assertions.assertEquals("mbmbexppbh", model.containerRegistry()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java deleted file mode 100644 index 1a2853961942f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceUpdateParameters model = - BinaryData - .fromString( - "{\"tags\":{\"yqduujit\":\"mgxsab\",\"rwpdappdsbdkvwrw\":\"jczdzevndh\"},\"sku\":{\"name\":\"eusnhutj\",\"tier\":\"Premium\",\"size\":\"rl\",\"family\":\"ugjzzdatqxhocdge\",\"capacity\":1293628182},\"identity\":{\"principalId\":\"1766dab0-b6cc-422f-8a7a-5b439fec6fab\",\"tenantId\":\"31064613-1bc8-43cc-a67e-db3b41e6f75c\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"dvkaozw\":{\"principalId\":\"47285ad5-2fb1-4802-9800-ef15b64c9005\",\"clientId\":\"3461706a-d43b-4f70-a1e5-f37623e988fb\"},\"tyhxhurokft\":{\"principalId\":\"141163eb-a84e-4057-876d-ef2ca332a35a\",\"clientId\":\"61aace7e-3ef4-41e3-a5f3-cb34b3814d76\"},\"lniwpwcukjfkgiaw\":{\"principalId\":\"d961710b-4bea-4db4-ae21-054935aa3b87\",\"clientId\":\"52a95018-46dd-4fa9-860b-f8dafc12a373\"},\"ryplwckbasyypn\":{\"principalId\":\"14d938eb-6659-4bd4-b080-10c086f54a8e\",\"clientId\":\"a92d70a9-dbe7-4b71-a2b5-0096f3797152\"}}},\"properties\":{\"description\":\"sgcbac\",\"friendlyName\":\"ejk\",\"imageBuildCompute\":\"ynqgoulzndlikwyq\",\"serviceManagedResourcesSettings\":{},\"primaryUserAssignedIdentity\":\"ibmadgakeqsrxy\",\"publicNetworkAccess\":\"Disabled\",\"applicationInsights\":\"e\",\"containerRegistry\":\"ytb\"}}") - .toObject(WorkspaceUpdateParameters.class); - Assertions.assertEquals("mgxsab", model.tags().get("yqduujit")); - Assertions.assertEquals("eusnhutj", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("rl", model.sku().size()); - Assertions.assertEquals("ugjzzdatqxhocdge", model.sku().family()); - Assertions.assertEquals(1293628182, model.sku().capacity()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("sgcbac", model.description()); - Assertions.assertEquals("ejk", model.friendlyName()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.imageBuildCompute()); - Assertions.assertEquals("ibmadgakeqsrxy", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("e", model.applicationInsights()); - Assertions.assertEquals("ytb", model.containerRegistry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceUpdateParameters model = - new WorkspaceUpdateParameters() - .withTags(mapOf("yqduujit", "mgxsab", "rwpdappdsbdkvwrw", "jczdzevndh")) - .withSku( - new Sku() - .withName("eusnhutj") - .withTier(SkuTier.PREMIUM) - .withSize("rl") - .withFamily("ugjzzdatqxhocdge") - .withCapacity(1293628182)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "dvkaozw", - new UserAssignedIdentity(), - "tyhxhurokft", - new UserAssignedIdentity(), - "lniwpwcukjfkgiaw", - new UserAssignedIdentity(), - "ryplwckbasyypn", - new UserAssignedIdentity()))) - .withDescription("sgcbac") - .withFriendlyName("ejk") - .withImageBuildCompute("ynqgoulzndlikwyq") - .withServiceManagedResourcesSettings(new ServiceManagedResourcesSettings()) - .withPrimaryUserAssignedIdentity("ibmadgakeqsrxy") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withApplicationInsights("e") - .withContainerRegistry("ytb"); - model = BinaryData.fromObject(model).toObject(WorkspaceUpdateParameters.class); - Assertions.assertEquals("mgxsab", model.tags().get("yqduujit")); - Assertions.assertEquals("eusnhutj", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("rl", model.sku().size()); - Assertions.assertEquals("ugjzzdatqxhocdge", model.sku().family()); - Assertions.assertEquals(1293628182, model.sku().capacity()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("sgcbac", model.description()); - Assertions.assertEquals("ejk", model.friendlyName()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.imageBuildCompute()); - Assertions.assertEquals("ibmadgakeqsrxy", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("e", model.applicationInsights()); - Assertions.assertEquals("ytb", model.containerRegistry()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java deleted file mode 100644 index da29450819255..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().delete("f", "huwzbxpcqzgi", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java deleted file mode 100644 index e7f07d55c9f21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ExternalFqdnResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests { - @Test - public void testListOutboundNetworkDependenciesEndpointsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalFqdnResponse response = - manager - .workspaces() - .listOutboundNetworkDependenciesEndpointsWithResponse( - "ffffg", "uhznwhvuldbk", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java deleted file mode 100644 index 3b0b7388c4bda..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesResyncKeysMockTests { - @Test - public void testResyncKeys() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().resyncKeys("ygzqpjoisfmn", "ybdjnxumentq", com.azure.core.util.Context.NONE); - } -}